CVE-2021-42248: Duplicate Advisory Denial of Service Vulnerability
HIGHCVE-2021-42248 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-1333: Inefficient Regular Expression Complexity) affecting Duplicate Advisory libraries in the Go ecosystem. The issue involves redos via crafted json input in gjson. Remediation is available by upgrading affected packages to version 1.9.3.
CVE-2021-42248 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2021-42248
To remediate this vulnerability, upgrade all affected Duplicate Advisory dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/tidwall/gjson to 1.9.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/tidwall/gjson
How to Check if You Are Affected
To determine whether your application is affected by CVE-2021-42248, inspect your project dependencies for Duplicate Advisory:
inspect dependencies for github.com/tidwall/gjson
Analyze the terminal output to locate any version of Duplicate Advisory in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.9.3), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-1333: Inefficient Regular Expression Complexity, where the product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential. In Duplicate Advisory, 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-2021-42248 Affected Duplicate Advisory Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/tidwall/gjson
|
Go |
< 1.9.3
|
1.9.3
|
References
Frequently Asked Questions
What is CVE-2021-42248?
Which Duplicate Advisory versions are affected?
What version fixes CVE-2021-42248?
Is github.com/tidwall/gjson affected?
What is the CVSS score of CVE-2021-42248?
What CWE is associated with CVE-2021-42248?
How can I check Go dependencies for CVE-2021-42248?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-c9gm-7rfj-8w5h",
"modified" : "2024-05-03T20:39:36Z",
"published" : "2022-05-25T00:00:38Z",
"withdrawn" : "2024-05-03T20:39:36Z",
"aliases" : [ "CVE-2021-42248" ],
"summary" : "Duplicate Advisory: ReDoS via crafted JSON input in GJSON",
"details" : "## Duplicate Advisory\nThis advisory has been withdrawn because it is a duplicate of GHSA-ppj4-34rq-v8j9. This link is maintained to preserve external references.\n\n## Original Description\nGJSON <= 1.9.2 allows attackers to cause a redos via crafted JSON input.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/tidwall/gjson"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.9.3"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-42248"
}, {
"type" : "WEB",
"url" : "https://github.com/tidwall/gjson/issues/236"
}, {
"type" : "WEB",
"url" : "https://github.com/tidwall/gjson/issues/237"
}, {
"type" : "WEB",
"url" : "https://github.com/tidwall/gjson/commit/590010fdac311cc8990ef5c97448d4fec8f29944"
}, {
"type" : "WEB",
"url" : "https://github.com/tidwall/gjson/commit/77a57fda87dca6d0d7d4627d512a630f89a91c96"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/tidwall/gjson"
}, {
"type" : "WEB",
"url" : "https://pkg.go.dev/vuln/GO-2021-0265"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1333" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-06-06T21:20:02Z",
"nvd_published_at" : "2022-05-24T15:15:00Z"
}
}