Skip to content

integrity/brand-impersonation: tenant-owned broker, B2C and Google user-content hosts still spare an impersonating sign-in #1418

Closed

Description

@nc9

Found in review of #1399. The brand-impersonation exemptions are narrower than before but still open to anyone who can register a tenant or a page on a trusted host.

  • Hosted identity broker authorize endpoints are exempt for Google and Microsoft sign-in: <tenant>.auth0.com/authorize, <tenant>.okta.com/oauth2/.../v1/authorize, <tenant>.auth.<region>.amazoncognito.com/oauth2/authorize. Anyone can register such a tenant, and its authorize endpoint leads to a login page the tenant owner controls. (Supabase /auth/v1/authorize and Firebase /__/auth/handler are reserved platform endpoints and much lower risk.)
  • b2clogin.com counts as Microsoft's own host for any path, but Azure AD B2C tenants live there and are tenant-owned.
  • The google.com suffix match spares sites.google.com/view/..., docs.google.com/forms/... and script.google.com/macros/..., which host user content (same on main).

Acceptance Criteria

  • A Google or Microsoft sign-in control to a broker authorize endpoint is spared only when the provider is named in the query (connection=google-oauth2, provider=google, identity_provider=Google and equivalents); otherwise it is reported as an info finding
  • b2clogin.com is spared only on its authorize paths
  • User-content and non-sign-in hosts under google.com and microsoft.com are not treated as the brand's sign-in hosts: sites.google.com, docs.google.com, script.google.com, forms.google.com, drive.google.com, groups.google.com, storage.cloud.google.com, lookerstudio.google.com, colab.research.google.com, calendar.google.com, the translate.google.com proxy, the google.com/url and google.com/amp/s redirectors, forms.microsoft.com and answers.microsoft.com; accounts.google.com, accounts.youtube.com and the Microsoft sign-in hosts (login.microsoftonline.com, login.microsoftonline.us, login.live.com, login.windows.net) still are
  • The suffix matches (google.com, microsoft.com) are replaced by that explicit host list, with path allowlists where a host serves both sign-in and user content
  • Tests cover each host above with a spared and a reported shape
  • The rule docs state the narrowed exemptions

Activity

  1. added
    size: S
    rules
    security
    on Oct 31, 2026
  2. added theissue type on Oct 31, 2026
  3. changed the issue type fromtoon Oct 31, 2026
  4. nc9 commented on Nov 4, 2026

    @nc9
    ContributorAuthor

    Acceptance check against main 7c31d5b (hosts first released in v0.0.160, brokers in v0.0.156, all in v0.0.161):

    # Criterion Result Evidence
    1 Broker authorize endpoint spared only with the provider named, otherwise an info finding PASS, with a documented amendment IDENTITY_BROKER_ENDPOINTS and isBrokerEndpoint in packages/rules/src/integrity/signals.ts; integrity-evasions-784.test.ts "a broker authorize link for %s that does not name the provider is off-brand", "a hint is not enough on a tenant that is not the site's own". Issue #1494 later amended this (a tenant that is the site's own name is also spared, a foreign tenant is reported even with a hint); the rule page states it and the residual (a free tenant name can be registered first)
    2 b2clogin.com only on its authorize paths PASS brand-legit-hosts-1418.test.ts "b2clogin.com and ciamlogin.com are spared for the site's own tenant, on an authorize path only", and the real /tfp/<tenant>.onmicrosoft.com/<policy> shape
    3 User-content and non-sign-in hosts are not the brand's sign-in hosts; accounts and Microsoft login hosts still are PASS "user-content, redirector, proxy and non-sign-in hosts under google.com are reported" lists every host named in the issue; "the Microsoft sign-in hosts are spared" and "forms, answers and other microsoft.com hosts are reported"
    4 Suffix matches replaced by an explicit host list with path allowlists PASS "the brand data: no brand's host list is a registrable domain that hosts user content", and the google.com/accounts path cases
    5 Each host has a spared and a reported shape PASS the tests above plus "how a host is matched" (dot boundary, userinfo, backslash, trailing dot, look-alikes)
    6 Docs state the narrowed exemptions PASS docs/rules/integrity/brand-impersonation.mdx lists the hosts and the broker and B2C conditions

    Tests run on this main: brand-legit-hosts-1418.test.ts 19 pass, integrity-evasions-784.test.ts 83 pass, 0 fail.

    Ticked all six and closing.

    nik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    rulessecuritysize: S

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions