Skip to content

Add CVE-2022-35947 REST API authentication bypass#13

Open
UncleJ4ck wants to merge 2 commits into
Orange-Cyberdefense:mainfrom
UncleJ4ck:cve-2022-35947-auth-bypass
Open

Add CVE-2022-35947 REST API authentication bypass#13
UncleJ4ck wants to merge 2 commits into
Orange-Cyberdefense:mainfrom
UncleJ4ck:cve-2022-35947-auth-bypass

Conversation

@UncleJ4ck

Copy link
Copy Markdown

Splitting #12 into focused PRs per your feedback. This is the type-juggling auth bypass you flagged as interesting.

CVE-2022-35947 (GLPI 10.0.0-10.0.2). /apirest.php/initSession passes the user_token GET parameter to User::getFromDBbyToken() without checking it is a string. Sending it as a PHP array (user_token[0]=>= & user_token[1]=) makes the ORM build WHERE api_token >= '', which matches the first user with a non-empty API token and returns a session token unauthenticated. Fixed in 10.0.3 by an is_string() guard.

Notes:

  • Uses self.get, no hand-rolled requests.
  • @author is set to glpi: the GHSA (GHSA-7p3q-cffg-c8xh) credit is anonymized so there is no named researcher. Happy to change it if you know the reporter.
  • --check is read-only (attempts the bypass and reports the session token).
  • Requires the REST API enabled (Enable login with external token).

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.

1 participant