Repository navigation
Conversation
…hen its query names the provider #1494 Signed-off-by: Nik Cubrilovic <[email protected]>
… URL is not proof #1494 Signed-off-by: Nik Cubrilovic <[email protected]>
…ironment suffix; query read only for broker-shaped links #1494 Signed-off-by: Nik Cubrilovic <[email protected]>
…ap, co.uk, provider names, form queries); docs residual #1494 Signed-off-by: Nik Cubrilovic <[email protected]>
Merged
Contributor
Author
|
Landed in v0.0.156 as nik |
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.
Closes #1494.
IDENTITY_BROKER_ENDPOINTSmatched the host suffix and the path shape of a hosted broker's authorize endpoint. Those hosts let anyone register a tenant and a tenant can serve the path and customise its hosted login page, so a page could borrow the exemption.Change (
packages/rules/src/integrity/signals.ts)Each broker family now also needs its provider hint in the query, for the brand the label names:
connection(google-oauth2,windowslive, ...), Cognitoidentity_provider, Supabaseprovider, FirebaseproviderId: the value must be a Google or Microsoft provider name for the matching brand.idpis taken as the hint (a weaker check; the docs say so).CredentialDestinationcarries the query.Review round: a hint in the URL is not proof
The query is written by whoever wrote the link, so "a provider hint exists" cannot spare a control (
?idp=googleon a hostile tenant would). Now:example-login.auth0.comonexample.com) AND the query must name the provider the label does (Okta: a non-emptyidp, since its provider ids are opaque; the tenant is the check there). A foreign tenant is off-brand whatever the URL says, includingidp=google,idp=xandconnection=google-oauth2.acme-prodonwww.acme-group.comis fine,foo-123onacme.comis not) is now a single-signalinfo, never a failure. Documented.Tests (
integrity-evasions-784.test.ts, 44 pass)The existing broker test now uses real federation URLs with their hints. New: bare authorize URLs for all seven endpoint shapes, and URLs naming another provider (including a look-alike value, a hint hidden in another parameter's value, an empty
idp), each reported for Google and Microsoft labels, as a link with text and with anaria-label; Microsoft hints are spared for a Microsoft label and reported for a Google one; the bare-broker and plain-off-brand cases are treated alike. These fail without the change (the bare authorize URL was spared).Docs and CHANGELOG updated. Skill change: none.
nik
Round 2 (independent review)
.auth0.com+ optional region,.okta.com/oktapreview.com/okta-emea.com,.auth.<region>.amazoncognito.com), and it must EQUAL the site name (no hint needed: bareacme.okta.com/oauth2/v1/authorizeandacme.auth0.com/authorizeare spared, any connection name) or the name plus-prod|production|dev|staging|stage|test|qa|uat|preview(then the provider hint is required).-login,-sso,-secure,-eu,corp, prefixes, deeper labels, look-alikes, punycode are flagged. Floor of 3 letters stays and is documented.Skill change: none.
Round 3 (tests + docs only)
Tests for the review survivors: env hyphen/listed word, 3-5 letter names spared and 2 letters never, hint cap boundary (8,192 spared, 8,193 reported), deeper Okta/Cognito labels, co.uk site, Microsoft/Google provider names, form action and formaction queries for all tenant families. Docs: the hint cap and the residual (an attacker registering the exact tenant name first is spared); duplicate Supabase/Firebase sentence removed. Skill change: none.