6.3medium
c3p0 exposes a deserialization "sink" via JDBC DataSource bean properties
- Severity
- 6.3medium CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.28% (higher than 22% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-w6w4-rjh9-9r58
Description
c3p0 is a JDBC Connection pooling library. In versions prior to 0.14.0, c3p0 in combination with other libraries, can compose to a "sink" for deserialization gadgets. The JDBC spec's DataSource.getConnection() and ConnectionPoolDataSource.getPooledConnection() match the getXXX() form, so JavaBean libraries treat them as "properties" assumed safe while they actually call into JDBC drivers. Attackers can thus craft malicious DataSource objects whose property lookups invoke vulnerable drivers, then smuggle them in serialized form to where an application deserializes and auto-resolves bean properties — triggering the attack. This requires a susceptible DataSource/ConnectionPoolDataSource and JDBC driver on the CLASSPATH, plus a carrier that auto-looks-up JavaBean properties on = deserialization, most commonly a collection paired with an Apache commons-beanutils Comparator that sorts by bean properties. c3p0 supplied that susceptible DataSource/ConnectionPoolDataSource, which was an essential component of the trigger. This issue has been fixed in version 0.14.0.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| swaldman c3p0 | < 0.14.0 | CVE List |
| com.mchange:c3p0 (Maven) | before 0.14.0 | GitHub Advisory Database |
All scores
| GitHub_M | 6.3medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N |
Classification
What each source says
CVE List
c3p0 is a JDBC Connection pooling library. In versions prior to 0.14.0, c3p0 in combination with other libraries, can compose to a "sink" for deserialization gadgets. The JDBC spec's DataSource.getConnection() and ConnectionPoolDataSource.getPooledConnection() match the getXXX() form, so JavaBean libraries treat them as "properties" assumed safe while they actually call into JDBC drivers. Attackers can thus craft malicious DataSource objects whose property lookups invoke vulnerable drivers, then smuggle them in serialized form to where an application deserializes and auto-resolves bean properties — triggering the attack. This requires a susceptible DataSource/ConnectionPoolDataSource and JDBC driver on the CLASSPATH, plus a carrier that auto-looks-up JavaBean properties on = deserialization, most commonly a collection paired with an Apache commons-beanutils Comparator that sorts by bean properties. c3p0 supplied that susceptible DataSource/ConnectionPoolDataSource, which was an essential component of the trigger. This issue has been fixed in version 0.14.0.
GitHub Advisory Database
Impact
The JDBC spec defines the interface DataSource, with a method called getConnection(), and ConnectionPoolDataSource, with a method called getPooledConnection(). These methods are potentially dangerous. One way or another they trigger calls into JDBC drivers, which themselves are complicated, flexible tools which may be, and in practice sometimes have proven to be, susceptible to abuse.
Unfortunately, the JavaBean framework treats methods of this form, getXXX(), as JavaBean "properties", which JavaBean-related libraries often presume represent quick, safe-to-look-up, state or configuration.
Attackers therefore can construct malicious DataSource objects — objects whose calls to getConnection() or getPooledConnection() would trigger attacks via vulnerable JDBC drivers — and bundle them in contexts that automatically look up bean properties on deserialization. If an attacker can smuggle such an object in serialized form to a location from which an application will deserialize it, an attack is triggered.
It's not easy. It requires that a susceptible JDBC DataSource or ConnectionPoolDataSource be available on the application CLASSPATH, along with a susceptible JDBC driver, and a carrier that will automatically look up JavaBean properties on deserialization. In practice, the most common such carrier is the composition of a collection and a Comparator implementation that sorts based on JavaBean properties from Apache commons-beanutils.
But c3p0 prior to 0.14.0 offered the susceptible JDBC DataSource or ConnectionPoolDataSource, supplying an essential component of the trigger.
Patches
c3p0 versions 0.14.0 and above no longer participate in this class of attack, because they include explicit BeanInfo classes which exclude connection and pooledConnection from the list of "introspected" JavaBean properties. Since getConnection() and getPooledConnection() no longer define JavaBean properties, classes that promiscuously read JavaBean properties do not call them, and the attack is averted.
Workarounds
If users can ensure the safety of all JDBC drivers on the application CLASSPATH, or that no libraries lie on the CLASSPATH that can be composed to trigger automatic JavaBean property lookups on deserialization, then this attack is prevented. Nevertheless, given the complexity of modern JDBC drivers and typical Java application transitive dependencies, it is strongly recommended that users upgrade to c3p0 version 0.14.0 or higher.
Some versions of this attack are foiled by the stronger encapsulation and restriction of reflective access introduced in Java 16. Running applications on Java 16+ is therefore a potential mitigation.
This attack is described by Hans-Martin Münch in a blog post called "Look Mama, no TemplatesImpl".
NVD (es)
c3p0 es una biblioteca de pooling de conexiones JDBC. En versiones anteriores a la 0.14.0, c3p0, en combinación con otras bibliotecas, puede componer un ’sumidero’ para gadgets de deserialización. DataSource.getConnection() y ConnectionPoolDataSource.getPooledConnection() de la especificación JDBC coinciden con la forma getXXX(), por lo que las bibliotecas JavaBean los tratan como ’propiedades’ que se asumen seguras, mientras que en realidad llaman a los controladores JDBC. Los atacantes pueden así crear objetos DataSource maliciosos cuyas búsquedas de propiedades invocan controladores vulnerables, para luego introducirlos de forma serializada donde una aplicación deserializa y auto-resuelve las propiedades del bean, lo que desencadena el ataque. Esto requiere un DataSource/ConnectionPoolDataSource y un controlador JDBC susceptibles en el CLASSPATH, además de un portador que auto-busque las propiedades de JavaBean en la deserialización, más comúnmente una colección emparejada con un Comparator de Apache commons-beanutils que ordena por propiedades de bean. c3p0 suministró ese DataSource/ConnectionPoolDataSource susceptible, que fue un componente esencial del desencadenante. Este problema ha sido solucionado en la versión 0.14.0.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-55223 changed 2026-07-01 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-w6w4-rjh9-9r58 changed 2026-07-23 | CC-BY-4.0 |
| NVD | CVE-2026-55223 changed 2026-10-25 | Public domain |