Skip to content

fix(933111): prevent whitespace padding bypass in PHP double-extension upload#4547

Merged
fzipi merged 1 commit into
mainfrom
fix/933111
Mar 15, 2026
Merged

fix(933111): prevent whitespace padding bypass in PHP double-extension upload#4547
fzipi merged 1 commit into
mainfrom
fix/933111

Conversation

@fzipi
Copy link
Copy Markdown
Member

@fzipi fzipi commented Mar 15, 2026

what

  • add t:removeWhitespace transformation to rule 933111 (PL3 stricter sibling of 933110) to normalize filenames before regex evaluation
  • add 3 regression tests covering whitespace bypass variants in double-extension filenames (e.g. test. php.jpg, test.phar .png)

why

  • rule 933111 can be bypassed by inserting whitespace in the filename before the PHP extension (e.g. test. php.jpg) because the regex requires the dot to be immediately followed by the extension, and only t:lowercase is applied
  • same class of vulnerability as fixed in 933110

refs

@github-actions
Copy link
Copy Markdown
Contributor

📊 Quantitative test results for language: eng, year: 2023, size: 10K, paranoia level: 1:
🚀 Quantitative testing did not detect new false positives

@fzipi fzipi requested a review from a team March 15, 2026 19:51
Copy link
Copy Markdown
Member

@Xhoenix Xhoenix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fzipi fzipi added this pull request to the merge queue Mar 15, 2026
Merged via the queue into main with commit 2bac8f3 Mar 15, 2026
8 checks passed
@fzipi fzipi deleted the fix/933111 branch March 15, 2026 20:33
fzipi added a commit that referenced this pull request Mar 26, 2026
…upload detection

Backport upstream fixes from main (#4546, #4547, #4549) that add
t:removeWhitespace transformation to file upload detection rules,
preventing evasion via whitespace padding in filenames.

Rule 944140 (#4548) was not backported as it does not exist in v3.3.
fzipi added a commit that referenced this pull request Mar 27, 2026
* chore: pre-release v3.3.8

Signed-off-by: Felipe Zipitria <felipe.zipitria@owasp.org>

* docs: update changes

Signed-off-by: Felipe Zipitria <felipe.zipitria@owasp.org>

* ci: update versions

Signed-off-by: Felipe Zipitria <felipe.zipitria@owasp.org>

* ci: add pre-commit file

Signed-off-by: Felipe Zipitria <felipe.zipitria@owasp.org>

* fix: pre-commit fixes

Signed-off-by: Felipe Zipitria <felipe.zipitria@owasp.org>

* ci: use go-ftw 0.6.4

Signed-off-by: Felipe Zipitria <felipe.zipitria@owasp.org>

* fix(932180,933110,933111): prevent whitespace padding bypass in file upload detection

Backport upstream fixes from main (#4546, #4547, #4549) that add
t:removeWhitespace transformation to file upload detection rules,
preventing evasion via whitespace padding in filenames.

Rule 944140 (#4548) was not backported as it does not exist in v3.3.

* ci(lint): prevent duplicate workflow runs on PRs

Restrict push trigger to v3.3/dev and v3.3/master branches so that
pull requests only trigger the workflow once via the pull_request event,
instead of running both push and pull_request.

---------

Signed-off-by: Felipe Zipitria <felipe.zipitria@owasp.org>
fzipi added a commit that referenced this pull request Mar 28, 2026
Add t:removeWhitespace transformation to rules 932180, 933110, and 933111
to prevent file upload detection bypass via whitespace in filenames.

Backport of #4546, #4547, #4549 from main. Rule 944140 (#4548) skipped
as it does not exist in v3.3.
fzipi added a commit that referenced this pull request Mar 28, 2026
* chore: pre-release v3.3.9 (#4576)

Signed-off-by: Felipe Zipitria <felipe.zipitria@owasp.org>

* fix: backport whitespace padding bypass fixes for 932180, 933110, 933111

Add t:removeWhitespace transformation to rules 932180, 933110, and 933111
to prevent file upload detection bypass via whitespace in filenames.

Backport of #4546, #4547, #4549 from main. Rule 944140 (#4548) skipped
as it does not exist in v3.3.

---------

Signed-off-by: Felipe Zipitria <felipe.zipitria@owasp.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants