Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: authorizerdev/authorizer
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2.0.0
Choose a base ref
...
head repository: authorizerdev/authorizer
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2.0.1
Choose a head ref
  • 4 commits
  • 29 files changed
  • 1 contributor

Commits on Mar 21, 2026

  1. Configuration menu
    Copy the full SHA
    109ae0a View commit details
    Browse the repository at this point in the history

Commits on Mar 27, 2026

  1. fix: parameterize CQL/N1QL queries to prevent injection (#500)

    * fix: parameterize CQL/N1QL queries to prevent injection (CWE-943, CWE-209)
    
    Replace all fmt.Sprintf string interpolation of user-controlled values
    with parameterized queries across Cassandra (10 files, 66+ queries)
    and Couchbase (2 files, 3 queries) backends.
    
    Cassandra: use gocql ? placeholders with values passed to Query().
    Couchbase: use $param named parameters with NamedParameters option.
    
    * fix: convert json.Number to native types before passing to gocql
    
    The JSON decoder with UseNumber() produces json.Number values which
    gocql cannot marshal into CQL bigint columns. Add convertMapValues()
    helper to convert json.Number to int64/float64, called after every
    JSON map decode in dynamic INSERT/UPDATE queries.
    lakhansamani authored Mar 27, 2026
    Configuration menu
    Copy the full SHA
    73679fa View commit details
    Browse the repository at this point in the history

Commits on Mar 29, 2026

  1. Fix/validate redirect uri (#502)

    * fix: validate redirect_uri against AllowedOrigins to prevent open redirect token theft
    
    Six endpoints accepted user-controlled redirect_uri without validating
    against AllowedOrigins, allowing attackers to steal tokens by redirecting
    to malicious URLs. Added validators.IsValidOrigin() checks to:
    
    - ForgotPassword (GraphQL mutation)
    - MagicLinkLogin (GraphQL mutation)
    - SignUp (GraphQL mutation)
    - InviteMembers (GraphQL mutation)
    - OAuthLoginHandler (HTTP handler)
    - VerifyEmailHandler (HTTP handler, both query param and JWT claim fallback)
    
    * test: add redirect_uri validation tests for open-redirect prevention
    
    Tests verify that ForgotPassword, MagicLinkLogin, SignUp, and
    InviteMembers reject attacker-controlled redirect_uri values not
    matching AllowedOrigins, and accept valid ones.
    
    * test: fix redirect_uri validation tests to use correct AllowedOrigins format
    
    IsValidOrigin compares hostname:port (without protocol), so
    AllowedOrigins must be specified without the http:// prefix.
    Also use SQLite to allow tests to run without Docker/Postgres.
    
    * fix: rewrite IsValidOrigin to use net/url and normalize origins correctly
    
    The previous implementation compared allowed origins (e.g.
    "https://example.com") as raw regex against "hostname:port", so
    protocols in AllowedOrigins caused matches to always fail. Now both
    input URL and allowed origins are normalized via net/url.Parse to
    strip protocol/path before comparison. Also anchors the regex with
    ^...$ to prevent partial matches (e.g. "example.com" matching
    "notexample.com").
    
    Adds comprehensive unit tests covering: exact domains, custom ports,
    standard ports (80/443), bare domains without protocol, subdomains,
    deep subdomains, wildcard subdomains, wildcard with port, multiple
    origins, attacker URLs, www variants, and live domain scenarios.
    
    * fix: update InviteMembers test to use allowed origin for redirect_uri
    
    The test was using "https://authorizer.dev/" which is not in
    AllowedOrigins, so it now correctly gets rejected by the new
    redirect_uri validation. Updated to use "http://localhost:3000/"
    which matches the test config's AllowedOrigins.
    lakhansamani authored Mar 29, 2026
    Configuration menu
    Copy the full SHA
    6d9bef1 View commit details
    Browse the repository at this point in the history

Commits on Mar 30, 2026

  1. fix: prevent OAuth account pre-hijacking via unverified email linking (

    …#503)
    
    When an OAuth login matches an existing account by email, the handler
    now checks EmailVerifiedAt. If the existing account's email was never
    verified, the unverified account is deleted and a fresh one is created
    for the OAuth user. This prevents attackers from pre-registering with
    a victim's email to retain password access after the victim's OAuth login.
    lakhansamani authored Mar 30, 2026
    Configuration menu
    Copy the full SHA
    2a9d22f View commit details
    Browse the repository at this point in the history
Loading