fix(upload_security): Refine extractors to reduce false positives - #163
google-labs-jules[bot] wants to merge 1 commit into
Conversation
… realistic code patterns
|
👋 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. |
|
Held for human review. touches src/websec_validator/extractors/upload_security.py (protected path) CI is green; the merge gate stops here on scope, not on test results. Merge it yourself if the change is what you want. |
What
Refines
UploadSecurityExtractorregexes and heuristics to avoid flagging benign code paths.Why
KEY_FROM_NAMEpattern matchedoriginalnameeven when used inside log strings or unconnected statements. Fixed by tightening bounds.TRUST_CLIENT_MIMEpattern matchedmimetypecalls insideconsole.logandlogger.info, which are not security sinks. Handled with a local_is_safe_mimeheuristic.serve-no-nosniffflaggedres.sendFile('/absolute/path')orres.sendFile('file', { root: 'public' })which denote hardcoded static content rather than arbitrary user uploads. Resolved by skipping fully static literals in arguments.Risk
Low. Modifications are bounded string/AST-heuristic refinements, heavily constrained by regression tests (
test_upload_key_fp_string_match,test_upload_trust_client_mime_log_fp,test_upload_serve_static_string_fp) added intests/test_pentest_regressions.py. AllRemainingControlScopeTestscontinue to pass.PR created automatically by Jules for task 8865206105426281740 started by @raccioly