Skip to content

P3.3: Classifier — OAuth state parameter integrity #79

Description

@bjcorder

Parent tracker: #62
Spec: docs/superpowers/specs/2026-05-21-edge-case-hardening-design.md
Milestone: P3
Depends on: P3.1

Goal

Fire findings for missing, static, or unverified state parameters in OAuth flows.

Acceptance criteria

  • oauth_state_missing fires when an auth-code flow's authorize-URL builder lacks a state parameter.
  • oauth_state_static_review fires when state is assigned from a literal string (not crypto-random).
  • oauth_state_unverified_review fires when a callback handler reads state but no comparison against a stored value (session, cache, signed cookie) is visible.
  • Evidence-bound — each finding links the relevant flow / handler / state-assignment / state-read evidence IDs.

New check IDs

  • oauth_state_missing
  • oauth_state_static_review
  • oauth_state_unverified_review

Files touched

  • crates/sessionscope-classifier/src/oauth_flow.rs

Fixture expectations

  • Negative variants for each check.
  • Positive: state = crypto.randomBytes(...).toString('hex') with callback comparison present.
  • False-positive: state assigned from a function call to a custom CSRF helper — confirm no fire (link evidence as review-required).

Audit-then-decide

  • oauth_state_missing: candidate missing_validation_evidence, severity medium.
  • oauth_state_static_review: candidate dynamic_review_required, severity medium.
  • oauth_state_unverified_review: candidate missing_validation_evidence, severity high.
  • Feed into the consolidated P4.8 audit.

Doc-update checklist

  • docs/USAGE.md check catalog: three new IDs.
  • docs/COVERAGE_MATRIX.md: three rows.
  • CHANGELOG.md unreleased entry.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions