fix: reduce upload_security false positives#32
Conversation
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
What
Reduces false positives in
upload_security.pyregarding static file serving and allowlist checks.Why
res.sendFile(__dirname ...)shouldn't trigger theserve-no-nosniffalert since it is not serving user-generated uploads.validTypesandsupportedMimeTypesfalsely triggeredupload-trusts-client-mime.Risk
Low. Adds context awareness for static files explicitly mapped via
__dirnameorprocess.cwd(). If a file has mixed static and dynamic file serving, the new logic iterates and ensures that if any dynamic serve sink exists, the file is still correctly flagged. Also expanded the regex for allowlist variables. Added regression tests.PR created automatically by Jules for task 15566643719533193340 started by @raccioly