Skip to content

fix: Path traversal (arbitrary file write) in uploadPaste - #13

Open
MBK-fr wants to merge 1 commit into
masterfrom
darkmoon/fix-path-traversal-upload-paste
Open

MBK-fr wants to merge 1 commit into
masterfrom
darkmoon/fix-path-traversal-upload-paste

Conversation

@MBK-fr

@MBK-fr MBK-fr commented Nov 21, 2026

Copy link
Copy Markdown

Findings

Darkmoon campaign camp_20261119_c80c95bf (DVGA demo target).

Finding Severity Title Endpoint
vuln_2d1ec6 high Path Traversal in uploadPaste Mutation - Arbitrary File Write /graphql (mutation uploadPaste)
vuln_f52b32 medium Path Traversal Attempt in uploadPaste - Error Message Leaks Internal Paths http://dvga.demo.invalid:5013/graphql

Also covers the retest campaign camp_20261119_dmx2rt01: vuln_2d1ec6_rt, vuln_f52b32_rt.

Fix

save_file reduces the client filename with secure_filename, resolves the destination and refuses anything outside the upload directory; failures return a generic GraphQL error instead of the raw OS error (which leaked internal paths).

Files changed:

  • core/helpers.py
  • core/views.py

Validation intent

Manual verification that the documented exploit path no longer succeeds, plus the project's existing test suite. Changed Python files pass python3 -m py_compile.

Opened for human review; never auto-merged.


Darkmoon finding reference: vuln_2d1ec6, vuln_f52b32.

`save_file` reduces the client filename with `secure_filename`, resolves the destination and refuses anything outside the upload directory; failures return a generic GraphQL error instead of the raw OS error (which leaked internal paths).

Findings: vuln_2d1ec6, vuln_f52b32
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