fix: Resolve CodeQL security vulnerabilities (type confusion and Helmet misconfiguration) - #80
Merged
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
- Add lusca CSRF middleware after session setup - Validate constructed folder paths stay within SERVED_DIR in all 3 folder creation endpoints - Fixes CodeQL alerts for missing CSRF and uncontrolled path injection
- Sanitize requestPath with escapeHtml before injecting into HTML base href - Remove API key names from access logs to prevent clear-text logging of sensitive info - Fixes CodeQL alerts for reflected XSS and clear-text logging
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix CodeQL Security Vulnerabilities
Summary
This PR resolves 6 CodeQL security vulnerabilities identified in the codebase:
config/i18n.jsto prevent array/string confusion in locale parameter handlingfalsesettings for CSP and HSTS to use secure defaultslusca.csrf()middleware after session setup to protect against CSRF attacksrequestPathwithescapeHtmlbefore injecting into HTML<base>tagReview & Testing Checklist for Human
/folders,/*splat/folders, file upload with folder creation) and that path traversal attempts (using../, absolute paths, etc.) are properly blocked<base>href injection still display correctly after XSS sanitization, especially with special characters in pathsTest Plan
../../../etc, absolute paths, and verify they're rejected<script>and verify they're escaped in HTML?lang=en,?lang[]=en, and malformed parameters to verify proper handlingNotes
luscapackage license format issue ("Apache 2.0" vs "Apache-2.0") was accepted per user guidance