CVE-2021-45046

Apache Log4j2 Deserialization of Untrusted Data Vulnerability

Verified by Precogs Threat Research
Last Updated: May 1, 2023
Base Score
9.8CRITICAL

Executive Summary

CVE-2021-45046 is a critical severity vulnerability affecting appsec. It is classified as an undisclosed flaw. This vulnerability is actively being exploited in the wild.

Precogs AI Insight

"CVE-2021-45046 is a bypass of the initial Log4Shell fix (CVE-2021-44228). The incomplete patch in Log4j 2.15.0 still allowed attackers to craft malicious input patterns using Thread Context Map lookups that evade the JNDI restriction, enabling information leakage and remote code execution in non-default configurations. Attackers exploit crafted ${ctx:} and nested lookups to circumvent the allowedLdapHost/allowedLdapClasses restrictions. Precogs Application Security Module detects nested expression injection patterns and recursive lookup chains that bypass first-generation mitigations."

Exploit Probability (EPSS)
High (94.3%)
Public POC
Available
Exploit Probability
High (84%)
Public POC
Actively Exploited
Affected Assets
appsecNVD Database

What is this vulnerability?

CVE-2021-45046 is categorized as a critical Application Verification Flaw flaw. Based on our vulnerability intelligence, this issue occurs when the application fails to securely handle untrusted data boundaries.

Apache Log4j2 contains a deserialization of untrusted data vulnerability due to the incomplete fix of CVE-2021-44228, where the Thread Context Lookup Patte.

This architectural defect enables adversaries to bypass intended security controls, directly manipulating the application's execution state or data layer. Immediate strategic intervention is required.

Risk Assessment

MetricValue
CVSS Base Score9.8 (CRITICAL)
Vector StringCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
PublishedMay 1, 2023
Last ModifiedMay 1, 2023
Related CWEsN/A

Impact on Systems

Unauthorized Access: Flaws in application logic can permit unauthorized interaction with protected APIs.

Data Manipulation: Adversaries may alter critical application states, such as user roles or configurations.

Service Disruption: Improper error handling or unvalidated inputs can lead to resource exhaustion.

How to fix this issue?

Implement the following strategic mitigations immediately to eliminate the attack surface.

1. Defense in Depth Implement multi-layered validation (client-side, API gateway, and server-side).

2. Least Privilege Ensure backend service accounts operate with the absolute minimum rights required.

3. Security Regression Testing Integrate automated semantic security scanning into the deployment pipeline.

Vulnerability Signature

CVE-2021-45046 is a bypass of the initial Log4Shell fix (CVE-2021-44228). The incomplete patch in Log4j 2.15.0 still allowed attackers to craft malicious input patterns using Thread Context Map lookups that evade the JNDI restriction, enabling information leakage and remote code execution in non-default configurations. Attackers exploit crafted ${ctx:} and nested lookups to circumvent the allowedLdapHost/allowedLdapClasses restrictions. Precogs Application Security Module detects nested expression injection patterns and recursive lookup chains that bypass first-generation mitigations.

References and Sources

Vulnerability Code Signature

Attack Data Flow

StageDetail
SourceUntrusted User Input
VectorInput flows through the application logic without sanitization
SinkExecution or Rendering Sink
ImpactApplication compromise, Logic Bypass, Data Exfiltration

Vulnerable Code Pattern

# ❌ VULNERABLE: Unsanitized Input Flow
def process_request(request):
    user_input = request.GET.get('data')
    # Taint sink: processing untrusted data
    execute_logic(user_input)
    return {"status": "success"}

Secure Code Pattern

# ✅ SECURE: Input Validation & Sanitization
def process_request(request):
    user_input = request.GET.get('data')
    
    # Sanitized boundary check
    if not is_valid_format(user_input):
        raise ValueError("Invalid input format")
        
    sanitized_data = sanitize(user_input)
    execute_logic(sanitized_data)
    return {"status": "success"}

How Precogs Detects This

Precogs AI Analysis Engine maps untrusted input directly to execution sinks to catch complex application security vulnerabilities.\n

Is your system affected?

Precogs AI detects CVE-2021-45046 in compiled binaries, LLMs, and application layers — even without source code access.