fix(normalizer): strip mailto: prefix and query params from email targets (#353) - #356
Merged
NovaCode37 merged 1 commit intoSep 13, 2026
Conversation
…gets (NovaCode37#353) Signed-off-by: DYNOSuprovo <DYNOSuprovo@users.noreply.github.com>
|
Thanks for the first pull request here. CI needs a maintainer to approve the run before it starts, so it may sit for a bit before anything happens. |
This was referenced Sep 13, 2026
Owner
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
Closes #353.
When pasting an email target such as
mailto:someone@example.comormailto:a@b.com?subject=hi, themailto:prefix survived into the scan target string and was passed down to underlying email reconnaissance modules.This change keeps both normalizers (
cli.pyon the backend andfrontend/src/lib/scan-target.tson the frontend) in sync:mailto:prefixes (mailto:,MAILTO:).?(e.g.,?subject=x).email).Changes Made
cli.py(normalize_target):mailto:prefix.?to cleanly extract the email address.frontend/src/lib/scan-target.ts(normalizeScanTarget):mailto:and query parameter stripping logic before scheme and domain normalization.frontend/scripts/test-scan-target.mjs:normalizeScanTargettest assertions to verify thatmailto:is stripped rather than retained.mailto:a@b.com?subject=xand case-insensitive query parameter handling.detectScanTypecorrectly recognizesmailto:a@b.com?subject=xas'email'.tests/test_cli_target_normalization.py:test_normalize_targetverifyingmailto:user@example.com,MAILTO:USER@EXAMPLE.COM,mailto:a@b.com?subject=x, and mixed-case query strings all resolve to clean lowercased email addresses.test_detect_typeassertions formailto:inputs.Verification
node scripts/test-scan-target.mjsinfrontend/: Passed (scan target normalization tests passed).test:urls,test:i18n,test:i18n-lookup,test:scan-target,test:encoder): Passed.tsc --noEmit src/lib/scan-target.ts): Passed with 0 errors.pytest tests/test_cli_target_normalization.py: 20 passed.pytest tests/ -q): All 393 tests passed.flake8 --count --select=E9,F63,F7,F82): 0 errors.git commit -s).