Skip to content

fix: constrain hostname wildcards for GHSA-g93r-423x-w7h2 - #10011

Merged
lpcox merged 1 commit into
mainfrom
lpcox-fix-url-wildcard-advisory
Oct 15, 2026
Merged

lpcox merged 1 commit into
mainfrom
lpcox-fix-url-wildcard-advisory

Conversation

@lpcox

@lpcox lpcox commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • restore preserved .* wildcards with component-specific character classes
  • prevent hostname wildcards from consuming / and crossing into the URL path
  • add a regression test for https://.*.example.com/*

Security impact

Addresses GHSA-g93r-423x-w7h2. Previously, a preserved .* in the hostname portion of --allow-urls was compiled with the path wildcard class, allowing it to match /. An attacker-controlled URL such as https://evil.example/?x=.example.com/ could therefore match a broader allowlist pattern unexpectedly.

Validation

  • npm test -- --runInBand src/domain-patterns.test.ts — 88 tests passed
  • npm run type-check — passed
  • npx eslint src/domain-matchers.ts src/domain-patterns.test.ts — passed with pre-existing non-literal RegExp warnings only
  • commit hooks: full lint and TypeScript build passed

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
Copilot AI max review requested due to automatic review settings October 15, 2026 04:48
@github-actions

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 93.33% 93.33% ➡️ +0.00%
Statements 91.92% 91.92% ➡️ +0.00%
Functions 90.67% 90.67% ➡️ +0.00%
Branches 85.75% 85.76% 📈 +0.01%
📁 Per-file Coverage Changes (2 files)
File Lines (Before → After) Statements (Before → After)
src/domain-matchers.ts 98.1% → 98.2% (+0.04%) 98.1% → 98.2% (+0.04%)
src/log-directory-setup.ts 96.8% → 100.0% (+3.18%) 96.9% → 100.0% (+3.13%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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.

@lpcox
lpcox merged commit 9713072 into main Oct 15, 2026
30 checks passed
@lpcox
lpcox deleted the lpcox-fix-url-wildcard-advisory branch October 15, 2026 05:09
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.

2 participants