Skip to content

fix: add path validation in patch-novnc.mjs - #12

Open
anupamme wants to merge 1 commit into
Yinglianchun:mainfrom
anupamme:fix-repo-samewindow-patch-novnc-path-traversal
Open

anupamme wants to merge 1 commit into
Yinglianchun:mainfrom
anupamme:fix-repo-samewindow-patch-novnc-path-traversal

Conversation

@anupamme

Copy link
Copy Markdown

Summary

Fix critical severity security issue in web/novnc/patch-novnc.mjs.

Vulnerability

Field Value
ID V-001
Severity CRITICAL
Scanner multi_agent_ai
Rule V-001
File web/novnc/patch-novnc.mjs:4
Assessment Likely exploitable
CWE CWE-22

Description: The patch-novnc.mjs script accepts a file path via process.argv[2] and directly uses it in fs.readFileSync() and fs.writeFileSync() without any validation. An attacker who can control this argument can read arbitrary files or write to arbitrary locations on the filesystem using path traversal sequences like '../../../etc/passwd'.

Evidence

Exploitation scenario: An attacker who can invoke the script with controlled arguments executes: node web/novnc/patch-novnc.mjs '../../../etc/passwd' to read sensitive system files, or node web/novnc/patch-novnc.mjs.

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

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

Changes

  • web/novnc/patch-novnc.mjs

Behavior Preservation

The change is scoped to 1 file on the vulnerable path.


Automated security fix by OrbisAI Security

Automated security fix generated by OrbisAI Security
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.

1 participant