Skip to content

fix: add path validation in main.ts (CWE-22) - #187

Closed
anupamme wants to merge 1 commit into
e18e:mainfrom
anupamme:fix-repo-action-dependency-diff-cwe-22-artifact-path-traversal
Closed

anupamme wants to merge 1 commit into
e18e:mainfrom
anupamme:fix-repo-action-dependency-diff-cwe-22-artifact-path-traversal

Conversation

@anupamme

@anupamme anupamme commented Oct 6, 2026

Copy link
Copy Markdown

The artifact-path input is retrieved via core.getInput() and passed directly to fs.readFile() without path validation or sanitization. An attacker controlling workflow inputs can supply path traversal sequences (../../../etc/passwd) to read arbitrary files on the GitHub Actions runner filesystem. The affected code is src/main.ts:34. This change is the fix I would apply.

Reference: CWE-22

What changed

  • src/main.ts

Verification

No automated check could be run against this repository, so this change is unverified beyond review. Please treat it as a suggestion.


Automated security fix by OrbisAI Security

Automated security fix generated by OrbisAI Security
@43081j

43081j commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

oh? and how can an attack control inputs?

if a person has control of your workflow file's contents, us relying on a GitHub supplied input is the least of your worries. Send your bot elsewhere.

@43081j 43081j closed this Oct 6, 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