Executive brief
c3p0 is a widely used Java library that helps applications manage database connections efficiently. A security flaw in older versions allows an attacker to provide specially crafted data that the library then processes as a Java object. This can lead to the execution of malicious code on the server, potentially allowing an attacker to take full control of the application, access sensitive data, or disrupt operations.
Technical details
c3p0 prior to v0.12.0 is vulnerable to insecure deserialization and JNDI injection. The 'userOverridesAsString' property in several ConnectionPoolDataSource implementations was stored as a hex-encoded serialized Java object. An attacker with the ability to modify this property can provide a malicious serialized object or a javax.naming.Reference instance. The vulnerability is exacerbated by the mchange-commons-java dependency, which contains JNDI-like functionality that supports ungated remote 'factoryClassLocation' values. This allows an attacker to trigger the download and execution of arbitrary bytecode from a remote server, bypassing modern JDK JNDI restrictions. The issue is fixed in c3p0 v0.12.0, which switches to a CSV-based format and utilizes a hardened version of mchange-commons-java (0.4.0+).
Affected products
- swaldman c3p0 < 0.12.0
- swaldman c3p0-loom < 0.12.0
Timeline
- 2026-02-23: advisory: GitHub Security Advisory published
- 2026-02-26: disclosed: CVE-2026-27830 published to NVD
References
- https://github.com/swaldman/c3p0/commit/e14cbd8166e423e2e9a9d6f08b2add3433492d6e
- https://github.com/swaldman/c3p0/security/advisories/GHSA-5476-xc4j-rqcv
- https://mogwailabs.de/en/blog/2025/02/c3p0-you-little-rascal
- https://www.mchange.com/projects/c3p0/
- https://www.mchange.com/projects/c3p0/
- https://access.redhat.com/errata/RHSA-2026:18054
- https://access.redhat.com/errata/RHSA-2026:18055