Skip to content

P3.7: Classifier — client storage hygiene findings #83

Description

@bjcorder

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

Goal

Fire findings for tokens stored or transmitted via client-accessible channels.

Acceptance criteria

  • token_in_local_storage fires when localStorage.setItem writes a token-shaped key.
  • token_in_session_storage fires for sessionStorage.setItem.
  • token_in_url_path_or_fragment fires for URL builders embedding token-shaped keys in path segments or fragment identifiers (not query params — those remain covered by the existing detector).
  • client_secret_in_browser_code fires when a literal that looks like a client secret (or an identifier named client_secret, clientSecret) appears in a file path matching client-side heuristics (e.g., pages/, app/, src/components/, public/). Review-required since SessionScope cannot prove browser-only execution.
  • Evidence-bound — each finding links the storage-call evidence.

New check IDs

  • token_in_local_storage
  • token_in_session_storage
  • token_in_url_path_or_fragment
  • client_secret_in_browser_code

Files touched

  • crates/sessionscope-classifier/src/client_storage.rs (new)

Fixture expectations

  • Negative variants for each check.
  • Positive: tokens stored in HttpOnly cookies or in-memory only.
  • False-positive: localStorage.setItem('theme', 'dark') — confirm no fire.

Audit-then-decide

  • token_in_local_storage, token_in_session_storage: high_confidence_misconfiguration, severity high for literal token-shape keys.
  • token_in_url_path_or_fragment: high_confidence_misconfiguration, severity high.
  • client_secret_in_browser_code: dynamic_review_required, severity high (review-required because file-path heuristic).
  • Feed into the consolidated P4.8 audit.

Doc-update checklist

  • docs/USAGE.md check catalog: four new IDs.
  • docs/COVERAGE_MATRIX.md: four 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