CVE-2024-40489
Executive Summary
CVE-2024-40489 is a critical injection vulnerability affecting Jeecg-Boot versions 3.0.0 through 3.5.3. The vulnerability stems from lax character filtering in the application, allowing an attacker to inject arbitrary code via specially crafted HTTP requests. This can lead to remote code execution (RCE) on affected components. The vulnerability is currently unpatched, and no public proof-of-concept (PoC) or exploit code has been released. The EPSS score is 0.0%, indicating low exploitation activity in the wild, but the potential impact is severe.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
Jeecg-Boot is a Java-based rapid development framework. The vulnerability exists in the core framework itself, not in a specific package manager (NPM, PyPI, Go, Ruby). Therefore, supply chain package security considerations are not directly applicable. However, organizations using Jeecg-Boot should review their dependency chain for any custom or third-party components that may be affected.
CVSS Breakdown & Threat Level
The CVSS score is listed as 0.0, which is likely a placeholder. Based on the description (injection leading to arbitrary code execution), the actual CVSS score would be high (likely 9.8 or higher) with the following vector:
- Attack Vector (AV): Network (N)
- Attack Complexity (AC): Low (L)
- Privileges Required (PR): None (N)
- User Interaction (UI): None (N)
- Scope (S): Unchanged (U)
- Confidentiality (C): High (H)
- Integrity (I): High (H)
- Availability (A): High (H)
Threat Level: Critical. The vulnerability allows unauthenticated remote code execution with no user interaction.
Deep Dive & Mechanics
The vulnerability is an injection flaw in Jeecg-Boot's HTTP request handling. The application fails to properly sanitize or filter certain characters in user-supplied input. This allows an attacker to inject malicious payloads that are then processed by the application, leading to arbitrary code execution.
The exact injection point is not publicly disclosed, but it likely involves parameters in HTTP requests that are passed to a dynamic evaluation function (e.g., eval(), exec(), or similar) without proper validation. The "lax character filtering" suggests that the application blocks some characters but not all, allowing an attacker to bypass filters using encoding, obfuscation, or alternative syntax.
Attack Flow:
- Attacker identifies an endpoint that processes user input (e.g., a search field, API parameter, or form field).
- Attacker crafts a malicious payload that includes code to be executed (e.g., Java code, OS commands, or script).
- The payload is sent in an HTTP request to the vulnerable endpoint.
- The application processes the input without proper sanitization, executing the injected code.
- The attacker gains control over the application or underlying system.
Vulnerable vs. Patched Code
Since no patch is available, a direct code comparison cannot be made. However, based on the vulnerability description, the vulnerable code likely resembles:
// Vulnerable: Directly evaluating user input
String userInput = request.getParameter("input");
Object result = ScriptEngine.eval(userInput); // or similar
A patched version would include input validation and sanitization:
// Patched: Sanitize and validate input
String userInput = request.getParameter("input");
if (isValidInput(userInput)) {
// Process safely
} else {
throw new SecurityException("Invalid input");
}
Exploitation & Lab Setup
Red Team
Lab Setup:
- Deploy a vulnerable Jeecg-Boot instance (version 3.0.0 to 3.5.3) in a controlled environment.
- Identify endpoints that accept user input (e.g.,
/jeecg-boot/api/...). - Use a web proxy (e.g., Burp Suite) to intercept and modify requests.
Exploitation Steps:
- Send a benign request to a vulnerable endpoint to understand the input format.
- Craft a payload that bypasses character filters. For example, if single quotes are blocked, use double quotes or URL encoding.
- Inject a command to execute a reverse shell or read sensitive files.
- Example payload (conceptual):
GET /jeecg-boot/api/v1/query?input=#{new java.lang.ProcessBuilder('id').start().getInputStream().readAllBytes()} - Monitor the response for execution results.
Note: No public exploit code is available. The above is a conceptual example.
Blue Team
Detection Steps:
- Monitor HTTP requests for unusual patterns, especially in parameters that accept user input.
- Look for encoded characters, long strings, or attempts to bypass filters (e.g., double encoding, Unicode escapes).
- Check logs for errors related to script execution or command injection.
- Use the detection rules provided below.
Indicators of Compromise (IOCs)
Network IOCs:
- HTTP requests with suspicious payloads in parameters (e.g.,
#{...},${...},exec,eval). - Requests to endpoints like
/jeecg-boot/api/,/jeecg-boot/sys/, etc. - Unusual response sizes or error messages indicating code execution.
- HTTP requests with suspicious payloads in parameters (e.g.,
Host IOCs:
- Unexpected processes spawned (e.g.,
cmd.exe,/bin/sh). - New files created in web directories.
- Outbound connections to unknown IPs (reverse shells).
- Unexpected processes spawned (e.g.,
Log IOCs:
- Application logs showing
ScriptEngine.eval()or similar calls. - Error logs with stack traces related to injection.
- Application logs showing
Detection Engineering
YARA Rule
rule CVE_2024_40489_JeecgBoot_Injection {
meta:
description = "Detects potential injection attempts against Jeecg-Boot CVE-2024-40489"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-40489"
strings:
$injection1 = /#{.*?}/ ascii wide nocase
$injection2 = /\$\{.*?\}/ ascii wide nocase
$injection3 = /exec\(/ ascii wide nocase
$injection4 = /eval\(/ ascii wide nocase
$injection5 = /Runtime\.getRuntime\(\)/ ascii wide nocase
condition:
any of them
}
Sigma Rule
title: Jeecg-Boot Injection Attempt (CVE-2024-40489)
id: 12345678-1234-1234-1234-123456789abc
status: experimental
description: Detects HTTP requests with potential injection payloads targeting Jeecg-Boot
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
c-uri|contains:
- '#{'
- '${'
- 'exec('
- 'eval('
- 'Runtime.getRuntime()'
condition: selection
falsepositives:
- Legitimate use of template expressions (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-40489 Jeecg-Boot Injection Attempt"; flow:to_server; content:"#{"; http_uri; nocase; sid:1000001; rev:1;)
alert http any any -> any any (msg:"CVE-2024-40489 Jeecg-Boot Injection Attempt"; flow:to_server; content:"${"; http_uri; nocase; sid:1000002; rev:1;)
alert http any any -> any any (msg:"CVE-2024-40489 Jeecg-Boot Injection Attempt"; flow:to_server; content:"exec("; http_uri; nocase; sid:1000003; rev:1;)
alert http any any -> any any (msg:"CVE-2024-40489 Jeecg-Boot Injection Attempt"; flow:to_server; content:"eval("; http_uri; nocase; sid:1000004; rev:1;)
alert http any any -> any any (msg:"CVE-2024-40489 Jeecg-Boot Injection Attempt"; flow:to_server; content:"Runtime.getRuntime()"; http_uri; nocase; sid:1000005; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Isolate affected systems from the internet if possible.
- Monitor logs for signs of exploitation.
- Apply a Web Application Firewall (WAF) rule to block suspicious payloads (e.g., patterns like
#{,${,exec(,eval().
Long-term Fix:
- Upgrade to a patched version once available. Contact Jeecg-Boot vendor for updates.
- Implement input validation and output encoding for all user-supplied data.
- Use parameterized queries and avoid dynamic evaluation of user input.
- Conduct a security audit of the application code.
Workaround:
- If patching is not possible, disable or restrict access to vulnerable endpoints.
- Implement strict character whitelisting for input fields.
Valters IT
Securing Digital Frontiers
{/* [Security Hash: 6DF1B75A5F9D85B361FADEA3] */}
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.