Skip to content

fix: reduce basic-auth false positive for markdown mailto badges#38

Merged
EshwarCVS merged 1 commit into
FasterApiWeb:mainfrom
AchieverSana:fix/basic-auth-mailto-false-positive
Jul 11, 2026
Merged

fix: reduce basic-auth false positive for markdown mailto badges#38
EshwarCVS merged 1 commit into
FasterApiWeb:mainfrom
AchieverSana:fix/basic-auth-mailto-false-positive

Conversation

@AchieverSana

Copy link
Copy Markdown
Contributor

Summary

  • Fixed generic-basic-auth-url false-positive on markdown badge links followed by a mailto: link on the same line (e.g. shields.io badges).
  • Excluded ] and ( from the username/password character classes so the match can't span across markdown link syntax.
  • Added positive/negative test cases in tests/test-patterns.js.

Type of Change

  • Pattern improvement (reduces false positives/negatives)

Checklist

  • I have read CONTRIBUTING.md
  • Pattern validation passes (node scripts/check-patterns.js)
  • Tests pass (npm test)
  • No real secrets are included in this PR
  • Documentation is updated (if applicable)
  • I understand maintainers may require CODEOWNER review before merge

Test Plan

  • Ran node scripts/check-patterns.js — all 78 patterns valid, 0 errors
  • Ran node tests/test-patterns.js — 51 passed, 0 failed, including the new false-positive case
  • Verified https://admin:S3cr3tP4ss@internal.example-corp.com/api is still correctly flagged as basic auth

Related Issues

Fixes #26

@AchieverSana AchieverSana requested a review from EshwarCVS as a code owner July 11, 2026 10:57
@EshwarCVS EshwarCVS merged commit 8defc0c into FasterApiWeb:main Jul 11, 2026
7 checks passed
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.

[false-positive]

2 participants