Skip to content

fix(auth): harden token validation and refuse direct downloads without it #298

Closed

Description

@LouisHaftmann

Split out of #294 (item 1), reported by @chenrui333.

Direct downloads hand the runner a presigned storage URL whose only gate is the Actions runtime token. Proposed changes:

  • refuse to start with ENABLE_DIRECT_DOWNLOADS=true and SKIP_TOKEN_VALIDATION=true (presigned URLs on unverified claims) unless an explicit UNSAFE_… override is set
  • require exp (jose only checks it when present; GitHub runtime tokens always carry it)
  • optional ACTIONS_TOKEN_AUDIENCE
  • schema-check the ac claim and treat Permission as read/write bit flags, so a write-only scope is not used for reads
  • log only the jose error code and claim name, not the error (it carries the decoded claims)
  • configurable presigned URL lifetime DIRECT_DOWNLOAD_URL_TTL_SECONDS (default 600, today's fixed 10 minutes), with the Storage Reader Lease outliving the URL

Needs a decision: the startup guard is a breaking change for setups running both flags today; needs a release note.

Branch: chenrui333:fix/token-validation-safeguards. Its ADR number needs renumbering against #288's ADR-0010.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions