test: add missing test cases for PHP session file upload detection#4415
Merged
Conversation
Co-authored-by: fzipi <3012076+fzipi@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add protection against PHP session file upload attacks
test: add missing test cases for PHP session file upload detection
Jan 19, 2026
fzipi
approved these changes
Jan 19, 2026
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Jan 23, 2026
* feat: prevent php session files to be uploaded Signed-off-by: Felipe Zipitria <felipe.zipitria@owasp.org> * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestion from @fzipi * test: add missing test cases for PHP session file upload detection (#4415) * Initial plan * Add test cases for comma and uppercase handling Co-authored-by: fzipi <3012076+fzipi@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: fzipi <3012076+fzipi@users.noreply.github.com> * fix: nginx overrides Signed-off-by: Felipe Zipitria <felipe.zipitria@owasp.org> * fix: move to pl1 Signed-off-by: Felipe Zipitria <felipe.zipitria@owasp.org> --------- Signed-off-by: Felipe Zipitria <felipe.zipitria@owasp.org> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
Adds missing test coverage for rule 933220 (PHP session file upload detection) based on code review feedback. The existing rule supports 6-bit encoded session IDs (includes commas) and applies lowercase transformation, but lacked tests validating these behaviors.
Added test cases:
sess_abc123,def456,ghi789jkl) — validates 6-bit character set supportsess_ABC123def456ghi789jkl) — validatest:lowercasetransformationSESS_abc123def456ghi789jkl) — validates prefix transformationPartially addresses #4332
PR Checklist
commentfield to write the expected behaviorFurther comments
No rule changes — test-only additions. All new tests validated against existing regex pattern
(?:^|[/\x5c])sess_[,\-0-9a-z]{20,256}$.For the reviewer
ctl:requestBodyAccess=Offwere used in the rule✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.