Skip to content

fix: add path validation in main.js (CWE-22) - #110

Open
anupamme wants to merge 1 commit into
TechJeeper:mainfrom
anupamme:fix-repo-printventory-multi-agent-cwe-22-main-js
Open

anupamme wants to merge 1 commit into
TechJeeper:mainfrom
anupamme:fix-repo-printventory-multi-agent-cwe-22-main-js

Conversation

@anupamme

@anupamme anupamme commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

The /api/download/* endpoint extracts file paths from URL parameters using decodeURIComponent and string replacement without proper path canonicalization. While some validation exists for UNC paths and temp directories, the code does not comprehensively prevent directory traversal using '../' sequences before path resolution. The affected code is main.js:898. This change is the fix I would apply.

Reference: CWE-22

What changed

  • main.js

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

The /api/download/* endpoint extracts file paths from URL parameters using decodeURIComponent and string replacement without proper path canonicalization
Addresses CWE-22
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