Expand description
File-upload matchers ported from
guard_core/handlers/_suspatterns_file_upload.py (spec 4.0.2).
All four patterns anchor on a filename = "<quoted>" token whose boundary
is located by walking back over whitespace to a required boundary char.
The dangerous-extension marker carries a (?![A-Za-z0-9]) guard; the
guard is enforced with per-branch suffix checks in the reference’s
alternation order (php\d* first with digit backtracking, then the
literal branches), which reproduces the lookahead exactly.
Constants§
- BENIGN_
TERMINAL - Benign terminal extensions for the double-extension shape.
- DANGEROUS_
EXT - Dangerous extension alternation with
com(terminal-extension pattern). - DOUBLE_
EXT - Dangerous extension alternation for the double-extension marker (no
com).
Functions§
- dangerous_
marker_ at - Anchored-
posmatcher for\.(?:php\d*|<alternation>)(?![A-Za-z0-9]). - file_
upload_ scan_ matches _file_upload_scan_matches: candidates fromfilenametokens, classified per pattern; the emitted match spans the validated[match_start, end).