Skip to content
SSRF Advisory Intermediate CVE-2023-28857

GHSL-2023-009: Credentials leaks for LDAP authentication in Apereo CAS - CVE-2023-28857

Apereo CAS with X509 certificate authentication and LDAP directory fetches CRL distribution point URLs from the client certificate, which can be attacker-controlled LDAP URLs. When connecting to such a URL, CAS uses the same password configured for the legitimate LDAP server, leaking it to the attacker.

Michael Stepankin Follow

Originally disclosed on GitHub Security Lab

When CAS is configured to use X509 certificate authentication with LDAP directory, an unauthenticated user can leak the credentials for LDAP authentication. This is possible by sending a specially crafted X509 client certificate that contains a “CRL Distribution Points” extension with URLs pointing to a malicious…

artsploit, on GitHub Security Lab

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

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

The [redacted] fetches CRL distribution point URLs from the untrusted client certificate and uses the configured LDAP bind credentials when connecting to those URLs.

Impact

An unauthenticated user can leak the password used to LDAP connection configured on server.

What the attacker needed

CAS configured with X509 auth and LDAP; Attacker can supply a client certificate; Attacker controls an LDAP server

The fix

The issue was fixed in version 6.6.6.

How it was found

  1. Download and build CAS Overlay v6.6.4 with X509 support.
  2. Start CAS with LDAP authentication and CRL fetching enabled, using a test LDAP URL and credentials.
  3. Start a netcat listener on a local port to act as the attacker's LDAP server.
  4. Send a request with a malicious certificate containing a CRLDP extension pointing to the attacker's LDAP URL.
  5. Observe CAS connecting to the attacker's LDAP URL with the configured username and password.

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.

Apereo CAS is a login server. When it checks if a client certificate is revoked, it looks at a URL inside the certificate. An attacker can put their own URL there, and CAS will connect to it using the same password it uses for the real LDAP server, so the attacker learns that password.

What is SSRF?

The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.

More by Michael Stepankin

View all

16 more disclosed reports, best first.

More from GitHub Security Lab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Server-side request forgery (SSRF)

The lesson behind this report.

The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.