Skip to content

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

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