Skip to content

fix: match allowed regex fully - #1054

Merged
jmattheis merged 1 commit into
masterfrom
match-fully-allowed-regex
Sep 24, 2026
Merged

jmattheis merged 1 commit into
masterfrom
match-fully-allowed-regex

Conversation

@jmattheis

Copy link
Copy Markdown
Member

Fixes #1052

@jmattheis
jmattheis requested a review from a team as a code owner September 20, 2026 17:54

@eternal-flame-AD eternal-flame-AD left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Lgtm.

Also, I think a simpler solution is simply prepend/append a ^ and $ to the regex if it's not already there.

Ad a side note, I honestly didn't understand why this is strictly needed. I agree with the original issue that it seems like WebSocket won't be a viable cross origin attack vector (does not eliminate the need to exfiltrate token).

@jmattheis

jmattheis commented Sep 23, 2026 •

Copy link
Copy Markdown
Member Author

I see this more as a fix to make the setting behave as expected (must match the string fully). I'd say the current docs and issues seem to imply this.

I'll change it to wrap the user regex into "^(?:"+userregex+")$". So we don't need the longest() and stringindex stuff.

@codecov

codecov Bot commented Sep 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.09%. Comparing base (e6361ca) to head (8f2dad9).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1054      +/-   ##
==========================================
- Coverage   76.16%   76.09%   -0.07%     
==========================================
  Files          66       67       +1     
  Lines        3625     3619       -6     
==========================================
- Hits         2761     2754       -7     
- Misses        653      654       +1     
  Partials      211      211              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jmattheis
jmattheis enabled auto-merge September 23, 2026 18:34
@jmattheis
jmattheis added this pull request to the merge queue Sep 24, 2026
Merged via the queue into master with commit d02796b Sep 24, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

CORS and websocket origin allowlists match unanchored, so 'https://example.com' also allows 'https://example.com.evil.net'

2 participants