Skip to content

security: fix path traversal vulnerability in conversion API#532

Open
Fluxmux wants to merge 1 commit intoC4illin:mainfrom
Fluxmux:fix/path-traversal-vulnerability
Open

security: fix path traversal vulnerability in conversion API#532
Fluxmux wants to merge 1 commit intoC4illin:mainfrom
Fluxmux:fix/path-traversal-vulnerability

Conversation

@Fluxmux
Copy link

@Fluxmux Fluxmux commented Feb 8, 2026

1. Input Validation in src/pages/convert.tsx

Added a check to ensure the convertTo parameter does not contain path traversal characters (/, \, ..). This is the first line of defense, blocking malicious input as soon as it enters the system.

2. Robust Filename Construction in src/converters/main.ts

The original logic used a regex that would match the end of the string if the original file had no extension, allowing the malicious convertTo string to be appended. I've updated this to handle files without extensions explicitly and safely.


Summary by cubic

Blocks path traversal in the conversion API by validating convertTo input and safely building output filenames. Prevents writing files outside the output directory, including for files without extensions.

  • Bug Fixes
    • Reject convert_to values containing "/", "" or ".."; still require converterName.
    • Handle files without extensions and only replace the final extension when creating the new filename.

Written for commit edea7a5. Summary will update on new commits.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

@C4illin
Copy link
Owner

C4illin commented Feb 17, 2026

Nice catch! Looks good to me

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