Skip to content

Implement P3 OAuth flow and client storage hardening#98

Merged
bjcorder merged 30 commits into
mainfrom
p3-oauth-flow-client-storage
May 24, 2026
Merged

Implement P3 OAuth flow and client storage hardening#98
bjcorder merged 30 commits into
mainfrom
p3-oauth-flow-client-storage

Conversation

@bjcorder

@bjcorder bjcorder commented May 24, 2026

Copy link
Copy Markdown
Owner

Summary

Implements milestone 13 / P3 OAuth flow + client storage hardening:

  • Adds oauth_flow detector and oauth_auth_code_flow artifact type.
  • Adds OAuth/OIDC classifiers for missing PKCE, state integrity, nonce validation, and broad redirect URI review.
  • Adds client_storage detector/classifier for localStorage, sessionStorage, URL path/fragment token exposure, and browser-path client secrets.
  • Extends redaction for OAuth state/nonce/PKCE material and browser storage token values.
  • Adds P3 fixtures and documentation/coverage matrix updates.

Implemented issues

Validation

  • cargo fmt --all -- --check — passed
  • cargo check --workspace — passed
  • cargo test -q — passed
  • cargo clippy --workspace --all-targets -- -D warnings — passed

Review notes

Fresh-context completion, correctness, and security reviews were run. Follow-up fixes addressed OAuth flow scoping, state/nonce verification false positives, and redaction coverage for OAuth/client-storage values, including template literals and report re-sanitization.

Risks / follow-ups

  • P3.1 artifact-type audit outcome: this PR adds oauth_auth_code_flow; include this in the P4.8 consolidated audit rollup.

View with Codesmith Autofix with Codesmith
Need help on this PR? Tag @codesmith with what you need. Autofix is disabled.

bjcorder added 27 commits May 21, 2026 22:21
@bjcorder

Copy link
Copy Markdown
Owner Author

Review/remediation update:

Summary:

  • Resolved PR Implement P3 OAuth flow and client storage hardening #98 merge conflicts with current origin/main in 6336bb0.
  • Narrowed OAuth flow detection to avoid arbitrary register(...) false positives.
  • Narrowed URL path/fragment token detection to avoid benign route false positives while keeping explicit token URL evidence.
  • Clarified document.cookie token writes as P3 detector evidence only.

Security/regression review:

  • Added OAuth nested literal redaction coverage for state/nonce/PKCE excerpts.
  • Added detector and core redaction coverage for unquoted camelCase clientSecret values.
  • Follow-up fresh-context merge-readiness and security reviews found no remaining blockers.

Merge conflicts:

  • Resolved in 6336bb0.

Validation:

  • cargo test -q -p sessionscope-detectors oauth_flow — passed
  • cargo test -q -p sessionscope-detectors client_storage — passed
  • cargo test -q -p sessionscope-classifier client_storage — passed
  • cargo test -q -p sessionscope-classifier jwt — passed
  • cargo test -q -p sessionscope-testing p3_oauth_and_client_storage_fixtures_emit_expected_findings — passed
  • cargo test -q -p sessionscope-testing p3_false_positive_fixtures_stay_clean — passed
  • cargo fmt --check — passed
  • cargo check --workspace — passed
  • cargo test -q — passed
  • cargo clippy --workspace --all-targets -- -D warnings — passed

Commits pushed:

Remaining notes:

  • GitHub checks were queued after push at the time of this update.

Comment thread crates/sessionscope-reporters/src/lib.rs Fixed
bjcorder and others added 2 commits May 24, 2026 08:50
… sensitive information'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@bjcorder

Copy link
Copy Markdown
Owner Author

CI remediation update:

Summary:

  • Investigated failing Rust CI jobs on Ubuntu, macOS, and Windows.
  • Root cause was cargo fmt --all -- --check failing after commit 7defb93 changed a reporter assertion without rustfmt formatting.
  • Applied rustfmt-compatible formatting in 22b0932 and pushed to the PR branch.

Validation:

  • cargo fmt --all -- --check — passed
  • cargo check --workspace — passed
  • cargo test -q — passed
  • cargo clippy --workspace --all-targets -- -D warnings — passed

Commits pushed:

Remaining notes:

  • Waiting for GitHub checks from the latest push to complete.

@bjcorder
bjcorder merged commit bab1ab8 into main May 24, 2026
10 checks passed
@bjcorder
bjcorder deleted the p3-oauth-flow-client-storage branch May 24, 2026 14:01
bjcorder added a commit that referenced this pull request May 24, 2026
* Fix #70: P2.1 Detector — JWT verify-options key extraction

* Fix #71: P2.2 Classifier — JWT alg:none acceptance

* Fix #72: P2.3 Classifier — JWT algorithm-confusion signal

* Fix #73: P2.4 Classifier — JWT header-trust risks

* Fix #74: P2.5 Classifier — nbf, clock-skew, kid validation gaps

* Fix #75: P2.6 Fixtures — JWT crypto-trust scenarios

* Fix #76: P2.7 Docs — P2 check catalog and coverage matrix rows

* Fix #73: Address JWT crypto-trust review findings

* Fix #73: Keep JWT verify helper clippy-clean

* Fix #77: P3.1 oauth_flow scaffold and registration

* Fix #85: P3.9 OAuth state nonce and PKCE redaction

* Fix #78: P3.2 PKCE missing classifier

* Fix #79: P3.3 OAuth state integrity classifier

* Fix #80: P3.4 OIDC nonce classifier

* Fix #81: P3.5 redirect URI wildcard classifier

* Fix #82: P3.6 client_storage detector registration

* Fix #83: P3.7 client storage hygiene classifier

* Fix #84: P3.8 OAuth and client storage fixtures

* Fix #86: P3.10 document OAuth flow and storage coverage

* Fix #83: restore client storage test import

* Fix #83: scope client storage test import

* Fix #82: narrow client storage URL token evidence

* Fix #77: address P3 review flow scoping and redaction

* Fix #77: tighten P3 review redaction and flow bounds

* Fix #77: resolve focused P3 review blockers

* Fix #77: preserve pre-flow OAuth evidence in segment

* Fix #83: keep P3 classifier tests clippy-clean

* Potential fix for pull request finding 'CodeQL / Cleartext logging of sensitive information'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* Address PR #98 review findings

* Fix #87: P4.1 Classifier — JWT denylist absent on logout

* Fix #88: P4.2 Classifier — refresh-family revocation absent on logout

* Fix #89: P4.3 Classifier — sliding expiry without rotation

* Fix #90: P4.4 Classifier — password-change without global revocation

* Fix #91: P4.5 Fixtures — false-positive coverage for new checks

* Fix #92: P4.6 JSON snapshot tests per framework family

* Fix #93: P4.7 CLI exit-code matrix tests

* Fix #94: P4.8 Consolidated category-audit decision

* Fix #95: P4.9 Final docs pass

* Address milestone 14 review findings

* Address PR #99 Windows snapshot check

* Fix Windows snapshot CI line endings

---------

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants