Skip to content
RCE Advisory Advanced CVE-2021-45046

GHSL-2021-1054_GHSL-2021-1055: Unsafe Deserialization in log4j2 - CVE-2021-45046

The mitigations in log4j2 2.15.0 that restrict LDAP lookup hosts and allowed deserialization classes can be bypassed. An attacker could bypass the host restriction and, by manipulating LDAP attributes or exploiting a race condition, achieve arbitrary code execution.

Alvaro Muñoz Follow

Originally disclosed on GitHub Security Lab

The mitigations to restrict the hosts that a LDAP lookup can connect to, and the classes that can be deserialized are bypassable.

pwntester, 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

Likely a parser differential between two URI parsers and a time-of-check-to-time-of-use race in the LDAP attribute handling.

Impact

This issue may lead to arbitrary code execution.

What the attacker needed

Log4j2 version 2.15.0; attacker controls LDAP server

The fix

The issue was fixed in version 2.16.

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.

Log4j2 is a logging library that can look up data from remote servers. Version 2.15.0 added checks to limit which servers it contacts and which Java classes it can load. This report shows those checks can be tricked, allowing an attacker to run their own code on the server.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by Alvaro Muñoz

View all

132 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.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.