Skip to content

fix: Validate email addresses#4005

Merged
Mrtenz merged 2 commits into
mainfrom
mrtenz/validate-email-address
May 18, 2026
Merged

fix: Validate email addresses#4005
Mrtenz merged 2 commits into
mainfrom
mrtenz/validate-email-address

Conversation

@Mrtenz
Copy link
Copy Markdown
Member

@Mrtenz Mrtenz commented May 18, 2026

Some basic validation for email addresses.


Note

Medium Risk
Updates validateLink mailto handling to fail fast on malformed email strings (e.g., multiple @), which may change which links are accepted and how phishing checks are applied.

Overview
Tightens mailto: link validation in validateLink by requiring each email recipient to contain exactly one @ before extracting the domain for phishing-list checks.

Adds a unit test to ensure malformed emails like mailto:foo@bar.com@baz.com throw a clear parse error and do not invoke the phishing-list checker.

Reviewed by Cursor Bugbot for commit d178d8a. Bugbot is set up for automated code reviews on this repo. Configure here.

@Mrtenz Mrtenz marked this pull request as ready for review May 18, 2026 09:00
@Mrtenz Mrtenz requested a review from a team as a code owner May 18, 2026 09:00
@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.58%. Comparing base (92ace80) to head (d178d8a).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4005   +/-   ##
=======================================
  Coverage   98.58%   98.58%           
=======================================
  Files         427      425    -2     
  Lines       12408    12370   -38     
  Branches     1949     1949           
=======================================
- Hits        12232    12195   -37     
+ Misses        176      175    -1     

☔ View full report in Codecov by Sentry.
📢 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.

Comment thread packages/snaps-utils/src/ui.tsx Outdated
Comment on lines 370 to 374
email.split('@').length === 2,
`Unable to parse email address "${email}".`,
);

const hostname = email.split('@')[1];
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.

Can we re-use the result of email.split()?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yep!

@Mrtenz Mrtenz enabled auto-merge May 18, 2026 09:12
@Mrtenz Mrtenz added this pull request to the merge queue May 18, 2026
Merged via the queue into main with commit 826159d May 18, 2026
129 checks passed
@Mrtenz Mrtenz deleted the mrtenz/validate-email-address branch May 18, 2026 09:23
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