Sanitize audio filename before forwarding to ElevenLabs API#112
Sanitize audio filename before forwarding to ElevenLabs API#112anshul23102 wants to merge 1 commit into
Conversation
…dhesh#69) Add sanitizeFilename helper to remove path traversal characters and special characters from audioFile.originalname before appending to FormData. Prevents injection attacks targeting the external API. Changes: - Add sanitizeFilename() function removing non-alphanumeric chars except dot, underscore, hyphen - Remove consecutive dots to prevent directory traversal - Limit filename length to 100 characters - Use sanitized filename in FormData append for voice clone uploads Security prevents: - Path traversal sequences (../../etc/passwd) - Null byte injection attacks - Special character injection in filenames - Command injection via filenames Fixes itzzavdhesh#69
|
Could the maintainers please add relevant labels? Suggested: type:security, severity:medium, area:api, nsoc |
|
@anshul23102 is attempting to deploy a commit to the itzzavdhesh's projects Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughThe PR adds filename sanitization to the ChangesFilename Sanitization for ElevenLabs Integration
Estimated Code Review Effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly Related Issues
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
DCO Sign-off NeededHi @anshul23102, this PR is missing a valid The DCO sign-off confirms that you have the right to submit this contribution. Commits To Fix
Fix The Most Recent Commitgit commit --amend --signoff
git push --force-with-leaseFix Multiple CommitsReplace git rebase --signoff HEAD~N
git push --force-with-leaseAfter you push the signed commits, this comment will update automatically. VoiceForge automation |
PR Needs A Quick UpdateHi @anshul23102, thank you for opening this PR. The PR is close, but a few validation checks need attention before it can enter mentor review. Items To Fix
Update Guide
Label Summary
What Happens NextUpdate the PR title or description, then let the workflow run again. Once these blockers are clear, the correct program mentor(s) will be requested for review. VoiceForge automation |
|
Hi @anshul23102 , please use the correct template only then your PR or issue will be reviewed issue template : https://github.com/itzzavdhesh/VoiceForge/tree/main/.github/ISSUE_TEMPLATE PR template : https://github.com/itzzavdhesh/VoiceForge/tree/main/.github/PULL_REQUEST_TEMPLATE |
Sanitize audio filename before forwarding to ElevenLabs API
Sanitizes the audio filename extracted from upload to prevent path traversal and injection attacks when forwarding to ElevenLabs API.
Changes
server/controllers/voiceController.jsKey Features
Test Plan
Fixes #69
🤖 Generated with Claude Code