Skip to content

fix: leave a field named outside [A-Za-z0-9-] out of the server params - #6

Open
roxblnfk wants to merge 1 commit into
1.xfrom
fix/unsafe-field-names
Open

roxblnfk wants to merge 1 commit into
1.xfrom
fix/unsafe-field-names

Conversation

@roxblnfk

@roxblnfk roxblnfk commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

🔍 What was changed

  • A request field named outside [A-Za-z0-9-] no longer reaches the server params, and so neither Laravel's headers: Symfony builds its header bag from them.
  • . is no longer folded into _: X_Forwarded_For and X.Forwarded.For used to land on HTTP_X_FORWARDED_FOR and pose as the real header, trusted proxy handling included.

Why?

In worker mode the host drops such fields before filling $_SERVER (unsafe_field_names = "drop", the default); in dispatcher mode it passes them through, so the factory has to drop them itself to match. Same as rapira-rs/sdk-php's dispatcher factory does.

Checklist

  • How was this tested:
    • Unit tests updated
    • Unit and Feature suites and php-cs-fixer run locally
    • Acceptance suite

Dots and underscores were folded into `_`, so `X_Forwarded_For` or `X.Forwarded.For` landed on `HTTP_X_FORWARDED_FOR` and could pose as the real header — to trusted proxy handling too, since Symfony builds its headers from these params. In worker mode the host drops such fields before filling `$_SERVER`; in dispatcher mode it passes them through, so the factory now drops them itself.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
@roxblnfk
roxblnfk requested a review from a team as a code owner October 8, 2026 11:44
@coderabbitai

coderabbitai Bot commented Oct 8, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: c6607423-4308-431e-8696-84ed28af6127
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant