Skip to content

fix(932180): prevent whitespace padding bypass in restricted file upload detection#4549

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

fix(932180): prevent whitespace padding bypass in restricted file upload detection#4549
fzipi merged 1 commit into
mainfrom
fix/932180

Conversation

@fzipi
Copy link
Copy Markdown
Member

@fzipi fzipi commented Mar 15, 2026

what

  • add t:removeWhitespace transformation to rule 932180 so filenames with whitespace padding are normalized before @pmFromFile matching
  • add 3 regression tests covering whitespace bypass variants (leading space, trailing space, multipart upload)

why

  • rule 932180 can be bypassed by inserting whitespace in the filename (e.g. settings. php or config.yml ) because the @pmFromFile substring matching won't find the entry from restricted-upload.data when whitespace is present
  • same class of vulnerability as fixed in 933110

refs

@fzipi fzipi requested a review from a team March 15, 2026 20:03
@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 added this pull request to the merge queue Mar 15, 2026
Merged via the queue into main with commit 98b749d Mar 15, 2026
8 checks passed
@fzipi fzipi deleted the fix/932180 branch March 15, 2026 20:57
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