Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
Tools/GitHubGitHub/federiconbaez/cortex9-oauthlib-token-grant-client-id-confusion-model
Authentication & AuthorizationVulnerability AnalysisCode AnalysisWeb SecurityPapers & ResearchLearning & EducationLabs & Practice
GitHubfedericonbaez/cortex9-oauthlib-token-grant-client-id-confusion-model

cortex9-oauthlib-token-grant-client-id-confusion-model

Offline educational model of CVE-2026-118669 (OAuthLib token-grant client_id confusion)

View Repository
11 days agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    1.0k
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    593
  • 3

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    381
  • 4

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    321
  • 5

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    316
  • 6

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    305

Explore all tools

Browse our collection of tools

View all tools →
Share

cortex9-oauthlib-token-grant-client-id-confusion-model

Offline model of CVE-2026-118669 (GHSA-7984-qgvg-3j9c): in OAuthLib before 4.0.0 the token grant handlers authenticate request.client as one client but keep an attacker-supplied client_id from the request body and pass it to validate_grant_type() and validate_scopes(). A client that authenticates as low and sends client_id=high gets grant and scope checks run as high when the application validator authorises by the client_id argument. Fixed by commit c951a1d09f99 (pre = before, post = after), released in 4.0.0.

Educational, offline, deterministic, Python stdlib only. oauthlib is not installed or imported; no HTTP request is made. The validator is the in-memory demo from the GHSA PoC (low: scopes read; high: read admin) plus batch, allowed only client_credentials.

Spanish: README.es.md. Exercises: PRACTICE.md.

What the fix changes (lines of the saved diff)

Diff linesprepost
117-124, 130 (client_credentials)authenticate_client, attribute check, validate_grant_type with the body client_id, then client_id = client_id or client.client_idvalidate_client_confidential (125) before the grant check
165, 180-184, 190-191 (password)client auth in create_token_response; fill after validate_grant_typevalidate_client_authentication inside validate_token_request (173)
23-28 (authorization_code), 150-152 (refresh_token), 235-243 (device_code)fill only if missing; refresh has no attribute checkremoved; binding happens in base.py
41-61 / 63-81 (base.py, added)—after authentication: client must have client_id (52-56 / 72-76); missing client_id is filled (58-59 / 78-79); a different one raises ServerError (60-61 / 80-81)
83-105 (base.py)inline confidential/public checks (87-103)dispatch to the two helpers
296-324, 345-353 (tests)—discrepancy → ServerError, missing attribute → NotImplementedError

base.py validate_grant_type / validate_scopes (unchanged by the fix, not in the diff) were read from the pre-fix file; see SOURCES.md.

Differential evidence (results/cases.tsv)

Caseprepost
p01 GHSA PoC, client_credentials, auth low, body client_id=high, scope=adminTOKEN_SPLIT: authenticated low, grant and scopes checked as high, admin grantedServerError (125; 58-61)
p02 same with passwordTOKEN_SPLITServerError (173; 58-61)
p03 batch (no password grant) sends client_id=highTOKEN_SPLITServerError
p05 public client, validator sets a different clientTOKEN_SPLITServerError (173; 78-81)
p06-p08 device / authorization code / refreshSTAGE_OK_SPLITServerError
n01, n02 GHSA controls (client_id=low, admin)InvalidScopeErrorsame
a01 no client_id in the body, policy argUnauthorizedClientError (grant checked as None)TOKEN
a03 validator authorises by request.clientTOKEN_SPLIT (scopes of low, token recorded as high)ServerError

*_SPLIT means the request finished with request.client_id different from request.client.client_id. STAGE_OK means the modelled steps passed for a grant whose code / refresh-token / device-code checks are not modelled.

Sweep (results/sweep.csv, 7,200 cases): post never ends split; every post success has request.client_id == request.client.client_id; every pre split becomes ServerError or NotImplementedError; when the body client_id equals the authenticated client the fix changes nothing.

Model observations, not findings: in pre, a client_credentials request without client_id in the body calls validate_grant_type(None, …) (the fill at diff:130 comes after the grant check), so a validator that authorises by the argument rejects it (a01). pre refresh_token with a client object lacking client_id raises a bare AttributeError at diff:151-152. Both depend on the demo validator.

Run

python3 tests/run.py                                    # any skip = failure
python3 scripts/derive_expected.py | diff - fixtures/expected.tsv
python3 scripts/derive_expected.py sweep | diff - results/sweep.csv
PYTHONPATH=src python3 -m oauthlib_model results fixtures/cases.tsv /tmp/r && diff -r results /tmp/r
PYTHONPATH=src python3 -m oauthlib_model case pre client_credentials confidential low auth high admin - arg

fixtures/cases.tsv holds hand labels; scripts/derive_expected.py re-derives every row from flat step lists without importing the model; the tests compare all three.

See LIMITATIONS.md and SOURCES.md. License: Apache-2.0.

Download Tool