
🔐 CVE-2026-57821 - Apache Fineract SQL Injection Toolkit 📚 Two Python scripts for authorized security testing: verifier.py (safe detection, no extraction) and exploit.py (deep analysis). Supports 11 DB types. Perfect for understanding SQL injection vulnerabilities. Only legal tests ⚠️ for educational & research purposes only.

⚠️ LEGAL & ETHICAL NOTICE
This toolkit is provided strictly for educational, training, and authorized security testing purposes.
Unauthorized use against any system without explicit written permission is illegal and violates computer crime laws.
The author assumes zero liability for misuse or damage.
You are solely responsible for your actions.
CVE-2026-57821 is a SQL Injection vulnerability discovered in Apache Fineract's office listing API endpoint.
| Attribute | Detail |
|---|---|
| Endpoint | /api/v1/offices |
| Parameter | orderBy |
| Method | GET |
| Authentication Required | Yes (authenticated users only) |
| Affected Versions | Apache Fineract ≤ 1.14.0 |
| Patched Version | Apache Fineract 1.15.0 |
The vulnerability exists because the orderBy parameter is directly embedded into SQL queries without proper sanitization. An attacker with valid credentials can inject subqueries wrapped in parentheses () into the orderBy parameter.
Why this bypasses previous fixes:
ColumnValidator to sanitize ORDER BY clausesORDER BY contextExample Attack Vector:
GET /api/v1/offices?orderBy=(SELECT CASE WHEN (1=1) THEN pg_sleep(5) ELSE pg_sleep(0) END)&limit=1
| Impact | Description |
|---|---|
| Data Exfiltration | Time‑based blind SQL injection can extract sensitive database content |
| Denial of Service | Heavy queries can exhaust connection pool resources |
| Information Disclosure | Error‑based techniques can reveal database structure and data |
This toolkit automatically detects and adapts exploitation techniques for 11 different database backends:
This project provides two Python scripts for different security assessment scenarios:
verifier.py – Safe & Minimal Verification ToolPurpose: Quickly prove vulnerability existence without extracting data.
What it does:
VULNERABLE or NOT VULNERABLE for each database type✅ Advantages:
📋 Use Case: First‑pass assessment to determine if the target is vulnerable.
exploit.py – Comprehensive Security AnalyzerPurpose: Fully exercise the vulnerability to extract database information.
What it does:
✅ Advantages:
📋 Use Case: In‑depth security analysis after vulnerability confirmation.
🔍 Key Difference:
verifierPoC.pytells you if it's vulnerable;exploit.pyshows you what can be extracted. Both serve distinct but complementary roles in a security assessment workflow.
requests librarypip install requests
Edit the following variables at the top of both scripts:
1️⃣ exploit.py - Deep Scan
python3 exploit.py
Expected Output:
CVE-2026-57821 - Apache Fineract Vulnerability Verifier
══════════════════════════════════════════════════════════════════════════════════════
@tc4dy is here :) Good Luck!
CONNECTION SUCCESS
BASELINE: 0.234s
STARTING VULNERABILITY VERIFICATION
VERIFICATION RESULTS
PostgreSQL: VULNERABLE
MySQL: NOT VULNERABLE
MariaDB: NOT VULNERABLE
Oracle: NOT VULNERABLE
MSSQL: NOT VULNERABLE
CONCLUSION: TARGET IS VULNERABLE (CVE-2026-57821 CONFIRMED)
Interpretation: If VULNERABLE appears for any database type, the target is affected.
CVSS Score Metric Value CVSS v3.1 Base Score 8.1 (High) Vector CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H Attack Vector Network Privileges Required Low User Interaction None EPSS Score
0.29% (probability of exploitation within 30 days)
CWE Mapping
CWE‑89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Why the Payload Works
The vulnerable code in Apache Fineract 1.14.0:
// Simplified vulnerable logic
String orderBy = request.getParameter("orderBy");
if (ColumnValidator.isValid(orderBy)) {
// VALIDATOR FAILS FOR: "(SELECT ...)"
// Only checks against simple column names
String sql = "SELECT * FROM offices ORDER BY " + orderBy;
// Executes query with user input directly
}
Attacker Payload Example:
GET /api/v1/offices?orderBy=(SELECT CASE WHEN (1=1) THEN pg_sleep(5) ELSE pg_sleep(0) END)&limit=1
Resulting SQL:
SELECT * FROM offices ORDER BY (SELECT CASE WHEN (1=1) THEN pg_sleep(5) ELSE pg_sleep(0) END)
The ColumnValidator checks for column names but misses the nested subquery, allowing arbitrary SQL execution.
| Attribute | Detail |
|---|
| Discoverer / Reporter | Terence Monteiro (Apache Fineract Team) |
| Public Disclosure Date | July 14, 2026 |
| Patched Version | Apache Fineract 1.15.0 |
| Official Announcement | Apache Mailing List |
| GitHub Fix | PR #6048 |
| Database | Detection Method | Exploitation Technique |
|---|
| PostgreSQL | Time‑based (pg_sleep) | Time‑based Blind |
| MySQL | Time‑based (SLEEP) | Time‑based Blind |
| MariaDB | Time‑based + @@version_comment | Time‑based Blind |
| MSSQL | Error‑based (CONVERT failure) | Error‑based |
| Oracle | Time‑based (DBMS_LOCK.SLEEP) | Time‑based Blind |
| SQLite | Heavy Query (Cartesian Join) | Time‑based (Heavy) |
| Firebird | Heavy Query (Cartesian Join) | Time‑based (Heavy) |
| DB2 | Heavy Query (Cartesian Join) | Time‑based (Heavy) |
| Informix | Heavy Query (Cartesian Join) | Time‑based (Heavy) |
| H2 | Heavy Query (Cartesian Join) | Time‑based (Heavy) |
| Unknown (Generic) | Fallback to PostgreSQL | Time‑based |
| Variable | Description | Default |
|---|
TARGET | Fineract API URL | http://localhost:8080/fineract-provider/api/v1/offices |
USERNAME | API authentication username | mifos |
PASSWORD | API authentication password | password |
TENANT_ID | Tenant identifier | default |
BASE_SLEEP | Sleep duration for time‑based tests (exploit.py) | 6 |
SLEEP_SECONDS | Sleep duration for time‑based tests (verifier.py) | 5 |
TIMEOUT | HTTP request timeout | 25 (exploit) / 15 (verifier) |
MAX_RETRIES | Retry count for failed requests | 2 |
| Action | Priority |
|---|
| Upgrade to Apache Fineract 1.15.0+ | 🔴 Critical |
| Apply PR #6048 patch | 🔴 Critical |
WAF Rule: Block orderBy containing (SELECT, SLEEP(, pg_sleep(, WAITFOR | 🟠 High |
Monitor logs for orderBy with parentheses or subquery keywords | 🟠 High |
| Database connection pool monitoring to detect resource exhaustion | 🟡 Medium |