Skip to content
OAuth / SSO Disclosed report Intermediate CVE-2021-29156

[CVE-2021-29156] LDAP Injection at https://██████

The target runs a version of ForgeRock OpenAM affected by CVE-2021-29156, which allows LDAP injection through the Webfinger protocol. An unauthenticated attacker could use it to retrieve password hashes character by character, or obtain a session token or private key.

Binit Ghimire Follow

Originally disclosed on HackerOne

  • Triaged in 28 hours
  • Fixed in 29 days
  • Disclosed after 30 days

Description: https://█████ is vulnerable to CVE-2021-29156

References

Impact

ForgeRock OpenAM before 13.5.1 allows LDAP injection via the Webfinger protocol. For example, an unauthenticated attacker can perform character-by-character retrieval of password hashes, or retrieve a session token or a private key.

System Host(s)

███████

Affected Product(s) and Version(s)

CVE Numbers

CVE-2021-29156

Steps to Reproduce

The references mentioned shall be helpful for successful reproduction, especially the one I reported the earlier day (#1278050) and the PortSwigger one.

  • Username starting with ██████████ exists: https://█████████/███/███████[200 OK]

  • Username starting with ███████ doesn't exist: https://██████████/██████████/█████████████[404 Not Found]

For 200 OK response, it also throws out OpenAM instance address: ███

Similar thing can be done for password enumeration as well. You can find the scripts I wrote for username and password enumeration in my earlier report at a different host.

Suggested Mitigation/Remediation Actions

The original report as published on HackerOne, by whoisbinit. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the Webfinger endpoint passes user-supplied input into an LDAP query without proper escaping, allowing injection.

Impact

An unauthenticated attacker could retrieve password hashes character by character, or obtain a session token or private key.

What the attacker needed

Unauthenticated access to the Webfinger endpoint

The fix

Versions before 13.5.1 are affected; upgrading to 13.5.1 or later would address it.

How it was found

  1. Request the Webfinger endpoint with a username that exists and observe a 200 OK response.
  2. Request the same endpoint with a username that does not exist and observe a 404 Not Found response.
  3. Use the difference in responses to enumerate valid usernames, and similarly enumerate passwords.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

LDAP is a directory service, like a phone book for user accounts. LDAP injection means sneaking extra instructions into a lookup so the server returns information it should not. Here the login-related Webfinger endpoint could be tricked into revealing whether a username exists and, in the worst case, secrets such as password hashes.

What is OAuth / SSO?

Mistakes in OAuth, OpenID Connect, SAML or token handling that leak codes and tokens or link an attacker's identity to a victim's account.

More by Binit Ghimire

View all

7 more disclosed reports, best first.

More from U.S. Dept Of Defense

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

OAuth and single sign-on flaws

The lesson behind this report.

Mistakes in OAuth, OpenID Connect, SAML or token handling that leak codes and tokens or link an attacker's identity to a victim's account.