Skip to content

fix: the cnonce (client nonce) value used in http di... in cam.js - #450

Merged
agsh merged 1 commit into
agsh:masterfrom
anupamme:fix-repo-onvif-secure-cnonce-generation
Jul 31, 2026
Merged

fix: the cnonce (client nonce) value used in http di... in cam.js#450
agsh merged 1 commit into
agsh:masterfrom
anupamme:fix-repo-onvif-secure-cnonce-generation

Conversation

@anupamme

Copy link
Copy Markdown
Contributor

Summary

Fix high severity security issue in lib/cam.js.

Vulnerability

Field Value
ID V-001
Severity HIGH
Scanner multi_agent_ai
Rule V-001
File lib/cam.js:418
Assessment Likely exploitable
Chain Complexity 5-step

Description: The cnonce (client nonce) value used in HTTP Digest authentication is generated using Math.random().toString(36), which is cryptographically insecure. Math.random() in JavaScript produces predictable pseudo-random numbers with insufficient entropy for security-critical operations. An attacker can predict or brute-force the cnonce value, potentially forging valid Digest authentication responses.

Evidence

Exploitation scenario: An attacker observes multiple authentication challenges from the target camera.

Scanner confirmation: multi_agent_ai rule V-001 flagged this pattern.

Production code: This file is in the production codebase, not test-only code.

Threat Model Context

This is a Node.js library - vulnerabilities affect downstream consumers who use this package.

Changes

  • lib/cam.js

Behavior Preservation

The change is scoped to 1 file on the vulnerable path, and the project builds successfully with this change applied.

Verification

  • Build passes
  • Scanner re-scan confirms fix
  • LLM code review passed

Automated security fix by OrbisAI Security

Automated security fix generated by OrbisAI Security
@agsh
agsh merged commit 9c1da0e into agsh:master Jul 31, 2026
5 checks passed
@agsh

agsh commented Jul 31, 2026

Copy link
Copy Markdown
Owner

@anupamme Hi! I never thought about this, thanks for the PR!

agsh added a commit that referenced this pull request Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants