Skip to content

fix: the scripts/check-markdown in check-markdown.js - #73

Closed
anupamme wants to merge 1 commit into
mynodebtc:masterfrom
anupamme:fix-repo-mynode-docs-check-markdown-path-traversal
Closed

anupamme wants to merge 1 commit into
mynodebtc:masterfrom
anupamme:fix-repo-mynode-docs-check-markdown-path-traversal

Conversation

@anupamme

Copy link
Copy Markdown

Summary

Fix high severity security issue in scripts/check-markdown.js.

Vulnerability

Field Value
ID V-001
Severity HIGH
Scanner multi_agent_ai
Rule V-001
File scripts/check-markdown.js:35
Assessment Likely exploitable

Description: The scripts/check-markdown.js file accepts a command-line argument at process.argv[2] and passes it directly to path.resolve() without validation. An attacker can provide a malicious path like '../../../etc/passwd' to traverse outside the intended docs directory and access sensitive files on the filesystem.

Evidence

Exploitation scenario: An attacker with ability to invoke the script can pass a path traversal payload: node scripts/check-markdown.js '../../../etc/passwd'.

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

Changes

  • scripts/check-markdown.js

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
@mynodebtc

Copy link
Copy Markdown
Owner

Thanks, but I'm closing this because it isn't a vulnerability.

process.argv[2] can only be set by whoever runs the script, and that person already has a shell on the machine. They could read /etc/passwd directly, so the script gives them nothing extra. Every caller (yarn docs:lint, the PR content check and the deploy workflow) runs it without arguments. The script also only reads .md files and never prints their contents: it reports file paths, line numbers and rule names, plus at most 60 characters of a flagged URI.

The path argument is there on purpose, for pointing the linter at test fixtures, so removing it would cost something and fix nothing.

@mynodebtc mynodebtc closed this Sep 12, 2026
@anupamme

Copy link
Copy Markdown
Author

Thanks for the clarification. I agree that, in this context, process.argv[2] does not provide an additional privilege boundary violation, since invoking the script already requires the ability to execute commands in the environment.

The original finding was based on the path-flow pattern without sufficiently accounting for the script’s execution context and intended use of the path argument. I’ll consider this finding a false positive and won’t pursue the original fix.

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