Repository navigation
fix: constrain hostname wildcards for GHSA-g93r-423x-w7h2 - #10011
Merged
Merged
Conversation
Use component-specific wildcard classes so hostname patterns cannot consume path separators. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2e724ab6-97e3-4891-8b60-2289f2668d99
Contributor
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (2 files)
Coverage comparison generated by |
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
This security-sensitive fix needs human verification of Squid’s URL normalization assumptions.
0 open findings
What changed in this PR
Tightens AWF URL allowlist matching to address GHSA-g93r-423x-w7h2.
Changes:
- Restricts preserved hostname wildcards so they cannot consume
/. - Adds regression coverage for valid subdomains and the reported bypass.
| File | Description |
|---|---|
| src/domain-patterns.test.ts | Adds hostname wildcard boundary regression coverage. |
| src/domain-matchers.ts | Restores preserved wildcards using component-specific character classes. |
🧠 Review effort: Max
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Summary
.*wildcards with component-specific character classes/and crossing into the URL pathhttps://.*.example.com/*Security impact
Addresses GHSA-g93r-423x-w7h2. Previously, a preserved
.*in the hostname portion of--allow-urlswas compiled with the path wildcard class, allowing it to match/. An attacker-controlled URL such ashttps://evil.example/?x=.example.com/could therefore match a broader allowlist pattern unexpectedly.Validation
npm test -- --runInBand src/domain-patterns.test.ts— 88 tests passednpm run type-check— passednpx eslint src/domain-matchers.ts src/domain-patterns.test.ts— passed with pre-existing non-literal RegExp warnings only