Skip to content

harden: add path validation in contactsheet.mjs - #12

Open
anupamme wants to merge 1 commit into
thrixel:mainfrom
anupamme:fix-repo-goal-to-game-path-traversal-contactsheet
Open

harden: add path validation in contactsheet.mjs#12
anupamme wants to merge 1 commit into
thrixel:mainfrom
anupamme:fix-repo-goal-to-game-path-traversal-contactsheet

Conversation

@anupamme

Copy link
Copy Markdown

Summary

Harden input handling in skills/goal-to-game/engines/threejs/tools/contactsheet.mjs (flagged by multi_agent_ai).

Vulnerability

Field Value
ID V-001
Severity HIGH
Scanner multi_agent_ai
Rule V-001
File skills/goal-to-game/engines/threejs/tools/contactsheet.mjs:20
Assessment Defensive hardening
CWE CWE-22

Description: Both contactsheet.mjs and pixelstats.mjs accept a directory path from command-line arguments (process.argv[2]) and resolve it using path.resolve() without any validation. This allows an attacker who can control the CLI arguments to read files from arbitrary locations on the filesystem using path traversal sequences like '../../../etc/passwd'. The tools then read PNG files from the specified directory and process them, potentially exposing sensitive file contents or system information.

Changes

  • skills/goal-to-game/engines/threejs/tools/contactsheet.mjs

Behavior Preservation

The change is scoped to 1 file on the vulnerable path; it only tightens handling of untrusted input and leaves valid inputs unaffected.


This patch removes an exploit primitive — a code pattern that, while not independently exploitable today, could be chained with other weaknesses by automated exploit-development tooling. Proactive removal of such primitives raises the bar against increasingly capable automated attack tools.


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