Skip to content

docs: warn that RegExp audiences should be anchored#1040

Open
Hashim1999164 wants to merge 1 commit into
auth0:masterfrom
Hashim1999164:docs/warn-unanchored-regex-audience
Open

docs: warn that RegExp audiences should be anchored#1040
Hashim1999164 wants to merge 1 commit into
auth0:masterfrom
Hashim1999164:docs/warn-unanchored-regex-audience

Conversation

@Hashim1999164

@Hashim1999164 Hashim1999164 commented Jul 22, 2026

Copy link
Copy Markdown

By submitting a PR to this repository, you agree to the terms within the Auth0 Code of Conduct. Please see the contributing guidelines for how to create and submit a high-quality PR for this repo.

Description

Documents that audience RegExp checks use RegExp#test (partial match) while string checks use exact equality, so unanchored patterns can accept unintended audiences. Updates the README examples to use anchored regexes and adds a short security note.

References

Testing

  • Docs-only change; no runtime behavior changed.

  • Reviewed README rendering of the updated audience option text.

  • This change adds test coverage for new/changed/fixed functionality

Checklist

  • I have added documentation for new/changed functionality in this PR or in auth0.com/docs
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not the default branch

String audience checks are exact matches, but RegExp audiences use
RegExp#test and can match unintended values when unanchored. Document
this and show anchored examples.

Fixes auth0#1019
@Hashim1999164
Hashim1999164 requested a review from a team as a code owner July 22, 2026 23:25
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.

Regex audience matching without anchors is a security footgun

1 participant