CVE-2022-25845: Fastjson Fastjson Vulnerability
HIGHCVE-2022-25845 is a HIGH (CVSS 8.1) fastjson vulnerability (CWE-502: Deserialization of Untrusted Data) affecting Fastjson libraries in the Maven ecosystem. The issue involves fastjson. Remediation is available by upgrading affected packages to version 1.2.83.
CVE-2022-25845 at a Glance
Security Impact
CVSS: 8.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2022-25845
To remediate this vulnerability, upgrade all affected Fastjson dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.83</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=com.alibaba
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2022-25845, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=com.alibaba
Analyze the terminal output to locate any version of Fastjson in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.2.83), your application is affected.
Note: The mvn dependency:tree -Dincludes=com.alibaba command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-502: Deserialization of Untrusted Data, where the product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid. In Fastjson, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-25845 Affected Fastjson Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
com.alibaba:fastjson
|
Maven |
≥ 1.2.25
< 1.2.83
|
1.2.83
|
References
Frequently Asked Questions
What is CVE-2022-25845?
Which Fastjson versions are affected?
What version fixes CVE-2022-25845?
Is fastjson affected?
What is the CVSS score of CVE-2022-25845?
What CWE is associated with CVE-2022-25845?
How can I check Maven dependencies for CVE-2022-25845?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-pv7h-hx5h-mgfj",
"modified" : "2024-05-15T06:28:35Z",
"published" : "2022-06-11T00:00:17Z",
"aliases" : [ "CVE-2022-25845" ],
"summary" : "Unsafe deserialization in com.alibaba:fastjson",
"details" : "The package com.alibaba:fastjson before 1.2.83 is vulnerable to Deserialization of Untrusted Data by bypassing the default autoType shutdown restrictions, which is possible under certain conditions. Exploiting this vulnerability allows attacking remote servers. Workaround: If upgrading is not possible, you can enable [safeMode](https://github.com/alibaba/fastjson/wiki/fastjson_safemode).",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "com.alibaba:fastjson"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.2.25"
}, {
"fixed" : "1.2.83"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-25845"
}, {
"type" : "WEB",
"url" : "https://github.com/alibaba/fastjson/commit/35db4adad70c32089542f23c272def1ad920a60d"
}, {
"type" : "WEB",
"url" : "https://github.com/alibaba/fastjson/commit/8f3410f81cbd437f7c459f8868445d50ad301f15"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/alibaba/fastjson"
}, {
"type" : "WEB",
"url" : "https://github.com/alibaba/fastjson/releases/tag/1.2.83"
}, {
"type" : "WEB",
"url" : "https://github.com/alibaba/fastjson/wiki/security_update_20220523"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/SNYK-JAVA-COMALIBABA-2859222"
}, {
"type" : "WEB",
"url" : "https://www.ddosi.org/fastjson-poc"
}, {
"type" : "WEB",
"url" : "https://www.oracle.com/security-alerts/cpujul2022.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-502" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-06-17T00:58:22Z",
"nvd_published_at" : "2022-06-10T20:15:00Z"
}
}