Deserialization of Untrusted Data in Gson
The package com.google.code.gson:gson before 2.8.9 is vulnerable to Deserialization of Untrusted Data via the writeReplace() method in internal classes, which may lead to denial of service attacks.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Java / Kotlin (Maven) | com.google.code.gson:gson | < 2.8.9 | 2.8.9 |
References
- https://nvd.nist.gov/vuln/detail/CVE-2022-25647
- https://github.com/google/gson/pull/1991
- https://github.com/google/gson/pull/1991/commits
- https://github.com/google/gson
- https://lists.debian.org/debian-lts-announce/2022/05/msg00015.html
- https://lists.debian.org/debian-lts-announce/2022/09/msg00009.html
- https://security.netapp.com/advisory/ntap-20220901-0009
- https://snyk.io/vuln/SNYK-JAVA-COMGOOGLECODEGSON-1730327
- https://www.debian.org/security/2022/dsa-5227
- https://www.oracle.com/security-alerts/cpujul2022.html
- CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:H/A:H- Weakness (CWE)
CWE-502- Platform
- Java / Kotlin (Maven)
- Package
com.google.code.gson:gson- Disclosed
- 03.05.2022
- Updated
- 11.10.2026 13:19
Sources and licenses
OSV / GitHub Advisory Database - GHSA-4jrv-ppp4-jm57 - CC BY 4.0
Vulnerability history: com.google.code.gson:gson
All published vulnerabilities of this package (Java / Kotlin (Maven)), newest first. Shows whether this is a one-off slip or a package that needs watching.
This is the only known vulnerability of this package.
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.