Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Properly terminate origin regex with $ #2576

Merged
merged 1 commit into from
Jul 12, 2024

Conversation

FrederikBolding
Copy link
Member

Fixes an oversight in the regex generation for allowedOrigins that allows a bypass of the functionality due to the regex not being properly terminated.

Also fixes a mistake in the regex generation that wouldn't properly add .* to the regex but instead use somewhat escaped characters.

@FrederikBolding FrederikBolding requested a review from a team as a code owner July 12, 2024 15:33
@FrederikBolding FrederikBolding changed the title fix: Properly terminate origin Regex with $ fix: Properly terminate origin regex with $ Jul 12, 2024
Copy link

codecov bot commented Jul 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.99%. Comparing base (c7f73bd) to head (e7f1c01).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2576   +/-   ##
=======================================
  Coverage   93.99%   93.99%           
=======================================
  Files         459      459           
  Lines        9647     9647           
  Branches     1480     1480           
=======================================
  Hits         9068     9068           
  Misses        579      579           

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

@FrederikBolding FrederikBolding merged commit 0a265dc into main Jul 12, 2024
156 checks passed
@FrederikBolding FrederikBolding deleted the fb/fix-origin-regexp branch July 12, 2024 15:42
danjm pushed a commit to MetaMask/metamask-extension that referenced this pull request Jul 15, 2024
## **Description**

This adds a patch for MetaMask/snaps#2576, which fixes a security issue
in the origin validation in Snaps.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/25823?quickstart=1)
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