Repository navigation
[Server] Validate Host and Origin independently - #589
Merged
chr-hertel merged 2 commits intoOct 13, 2026
Merged
chr-hertel merged 2 commits into
chr-hertel merged 2 commits into
Conversation
ausi
requested review from
CodeWithKyrian,
Nyholm,
chr-hertel and
soyuka
as code owners
October 13, 2026 16:01
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The implementation matches the issue requirements and includes comprehensive tests and documentation.
0 open findings
What changed in this PR
Separates Host and Origin validation in DNS rebinding protection.
Changes:
- Always validates Host and independently validates Origin.
- Adds separate allowlists, wildcard support, and same-origin handling.
- Expands transport tests and documentation for the breaking API change.
| File | Description |
|---|---|
src/Server/Transport/Http/Middleware/DnsRebindingProtectionMiddleware.php |
Implements independent Host and Origin validation. |
tests/Unit/Server/Transport/Http/Middleware/DnsRebindingProtectionMiddlewareTest.php |
Covers validation, wildcards, malformed values, and same-origin cases. |
tests/Unit/Server/Transport/StreamableHttpTransportTest.php |
Verifies Host enforcement with allowed Origins. |
tests/Unit/Server/Transport/StatelessHttpTransportTest.php |
Tests independent validation in stateless transport. |
docs/run/http.md |
Documents configuration and proxy usage. |
CHANGELOG.md |
Records the constructor and behavioral breaking changes. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Member
|
Thanks @ausi - pushed one commits on top: |
chr-hertel
force-pushed
the
fix/independent-host-origin-validation
branch
from
October 13, 2026 22:41
1210bbe to
6d393d0
Compare
chr-hertel
force-pushed
the
fix/independent-host-origin-validation
branch
from
October 13, 2026 23:10
eb2e8c7 to
f457470
Compare
chr-hertel
approved these changes
Oct 13, 2026
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.

Fixes #522
Breaking Changes
New constructor parameter
$allowedOriginsforDnsRebindingProtectionMiddlewareclass.Types of changes
Checklist