CVE-2021-27293: RestSharp Incorrect Regular Expression Vulnerability
HIGHCVE-2021-27293 is a HIGH (CVSS 7.5) incorrect regular expression vulnerability (CWE-185: Incorrect Regular Expression) affecting RestSharp libraries in the NuGet ecosystem. The issue involves incorrect regular expression in restsharp. Remediation is available by upgrading affected packages to version 106.11.8-alpha.0.13.
CVE-2021-27293 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-27293
To remediate this vulnerability, upgrade all affected RestSharp 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 RestSharp to 106.11.8-alpha.0.13
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for RestSharp
How to Check if You Are Affected
To determine whether your application is affected by CVE-2021-27293, inspect your project dependencies for RestSharp:
inspect dependencies for RestSharp
Analyze the terminal output to locate any version of RestSharp in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 106.11.8-alpha.0.13), 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-185: Incorrect Regular Expression, where the product specifies a regular expression in a way that causes data to be improperly matched or compared. In RestSharp, 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-27293 Affected RestSharp Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
RestSharp
|
NuGet |
< 106.11.8-alpha.0.13
|
106.11.8-alpha.0.13
|
References
Frequently Asked Questions
What is CVE-2021-27293?
Which RestSharp versions are affected?
What version fixes CVE-2021-27293?
Is RestSharp affected?
What is the CVSS score of CVE-2021-27293?
What CWE is associated with CVE-2021-27293?
How can I check NuGet dependencies for CVE-2021-27293?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-9pq7-rcxv-47vq",
"modified" : "2021-07-15T20:24:43Z",
"published" : "2021-07-14T19:10:01Z",
"aliases" : [ "CVE-2021-27293" ],
"summary" : "Incorrect Regular Expression in RestSharp",
"details" : "RestSharp < 106.11.8-alpha.0.13 uses a regular expression which is vulnerable to Regular Expression Denial of Service (ReDoS) when converting strings into DateTimes. If a server responds with a malicious string, the client using RestSharp will be stuck processing it for an exceedingly long time. Thus the remote server can trigger Denial of Service.",
"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" : "NuGet",
"name" : "RestSharp"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "106.11.8-alpha.0.13"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 106.11.7"
}
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-27293"
}, {
"type" : "WEB",
"url" : "https://github.com/restsharp/RestSharp/issues/1556"
}, {
"type" : "WEB",
"url" : "https://github.com/restsharp/RestSharp/commit/be39346784b68048b230790d15333574341143bc"
}, {
"type" : "WEB",
"url" : "https://restsharp.dev"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-185", "CWE-697" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2021-07-13T21:24:43Z",
"nvd_published_at" : "2021-07-12T11:15:00Z"
}
}