Skip to content

fix: compare tokens in constant time #101

Closed

Description

@uniqueg

Pubgrade checks the access tokens in the headers X-Project-Access-Token, X-User-Access-Token and X-Super-User-Access-Token against the stored ones with != (repositories, builds, subscriptions, users). Compare them with hmac.compare_digest instead, in one helper used by every check, so that each comparison takes the same time whatever the supplied value. Missing, empty or non-string values count as not matching; values outside ASCII are compared like others (UTF-8), not rejected.

Done when every token check uses the helper, with unit tests for matching, non-matching and missing tokens.

Activity

  1. added this to the v0.2.0 milestone on Nov 9, 2026
  2. added
    priority: high
    status: triage
    type: auth
    workload: minutes
    ecp-wp4: M4.3
    status: in progress
    and removed
    status: triage
    on Nov 9, 2026
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

    ecp-wp4: M4.3priority: highstatus: in progresstype: authworkload: minutes

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions