CVE-2020-5243: Uap core Denial of Service Vulnerability
MODERATECVE-2020-5243 is a MODERATE (CVSS 5.7) denial of service vulnerability (CWE-1333: Inefficient Regular Expression Complexity) affecting Uap core libraries in the npm ecosystem. The issue involves denial of service in uap-core when processing crafted user-agent strings. Remediation is available by upgrading affected packages to version 0.7.3, 2.6.0.
CVE-2020-5243 at a Glance
Security Impact
CVSS: 5.7
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H).
How to Fix CVE-2020-5243
To remediate this vulnerability, upgrade all affected Uap core dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install uap-core@0.7.3
Upgrade user_agent_parser to 2.6.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls uap-core
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2020-5243, inspect your project dependencies using npm:
npm ls uap-core
Analyze the terminal output to locate any version of Uap core in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.7.3), your application is affected.
Note: The npm ls uap-core command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
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 Uap core, 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-2020-5243 Affected Uap core Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
uap-core
|
npm |
< 0.7.3
|
0.7.3
|
|
user_agent_parser
|
RubyGems |
< 2.6.0
|
2.6.0
|
References
Frequently Asked Questions
What is CVE-2020-5243?
Which Uap core versions are affected?
What version fixes CVE-2020-5243?
Is uap-core affected?
Is user_agent_parser affected?
What is the CVSS score of CVE-2020-5243?
What CWE is associated with CVE-2020-5243?
How can I check npm dependencies for CVE-2020-5243?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-cmcx-xhr8-3w9p",
"modified" : "2024-02-08T22:49:51Z",
"published" : "2020-02-20T23:26:10Z",
"aliases" : [ "CVE-2020-5243" ],
"summary" : "Denial of Service in uap-core when processing crafted User-Agent strings",
"details" : "### Impact\n\nSome regexes are vulnerable to regular expression denial of service (REDoS) due to overlapping capture groups. This allows remote attackers to overload a server by setting the User-Agent header in an HTTP(S) request to maliciously crafted long strings.\n\n### Patches\n\nPlease update uap-core to &amp;gt;= v0.7.3\n\nDownstream packages such as uap-python, uap-ruby etc which depend upon uap-core follow different version schemes.\n\n### Details\n\nEach vulnerable regular expression reported here contains 3 overlapping capture groups. Backtracking has approximately cubic time complexity with respect to the length of the user-agent string.\n\n#### Regex 1:\n\n```\n\\bSmartWatch *\\( *([^;]+) *; *([^;]+) *;\n```\n\nis vulnerable in portion ` *([^;]+) *` and can be attacked with\n\n```python\n&amp;quot;SmartWatch(&amp;quot; + (&amp;quot; &amp;quot; * 3500) + &amp;quot;z&amp;quot;\n```\ne.g.\n```\nSmartWatch( z\n```\n\n\n#### Regex 2:\n\n```\n; *([^;/]+) Build[/ ]Huawei(MT1-U06|[A-Z]+\\d+[^\\);]+)[^\\);]*\\)\n```\n\nis vulnerable in portion `\\d+[^\\);]+[^\\);]*` and can be attacked with\n\n```python\n&amp;quot;;A Build HuaweiA&amp;quot; + (&amp;quot;4&amp;quot; * 3500) + &amp;quot;z&amp;quot;\n```\n\n\n#### Regex 3:\n\n```\n(HbbTV)/[0-9]+\\.[0-9]+\\.[0-9]+ \\([^;]*; *(LG)E *; *([^;]*) *;[^;]*;[^;]*;\\)\n```\n\nis vulnerable in portion ` *([^;]*) *` and can be attacked with\n\n```python\n&amp;quot;HbbTV/0.0.0 (;LGE;&amp;quot; + (&amp;quot; &amp;quot; * 3500) + &amp;quot;z&amp;quot;\n```\n\n#### Regex 4:\n\n```\n(HbbTV)/[0-9]+\\.[0-9]+\\.[0-9]+ \\([^;]*; *(?:CUS:([^;]*)|([^;]+)) *; *([^;]*) *;.*;\n```\n\nis vulnerable in portions ` *(?:CUS:([^;]*)|([^;]+)) *` and ` *([^;]*) *` and can be attacked with\n\n```python\n&amp;quot;HbbTV/0.0.0 (;CUS:;&amp;quot; + (&amp;quot; &amp;quot; * 3500) + &amp;quot;z&amp;quot;\n&amp;quot;HbbTV/0.0.0 (;&amp;quot; + (&amp;quot; &amp;quot; * 3500) + &amp;quot;z&amp;quot;\n&amp;quot;HbbTV/0.0.0 (;z;&amp;quot; + (&amp;quot; &amp;quot; * 3500) + &amp;quot;z&amp;quot;\n```\n\nReported by Ben Caller @bcaller",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "uap-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.7.3"
} ]
} ]
}, {
"package" : {
"ecosystem" : "RubyGems",
"name" : "user_agent_parser"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.6.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/ua-parser/uap-core/security/advisories/GHSA-cmcx-xhr8-3w9p"
}, {
"type" : "WEB",
"url" : "https://github.com/ua-parser/uap-ruby/security/advisories/GHSA-pcqq-5962-hvcw"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-5243"
}, {
"type" : "WEB",
"url" : "https://github.com/ua-parser/uap-core/commit/0afd61ed85396a3b5316f18bfd1edfaadf8e88e1"
}, {
"type" : "WEB",
"url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/user_agent_parser/CVE-2020-5243.yml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1333", "CWE-20" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2020-02-20T23:09:32Z",
"nvd_published_at" : "2020-02-21T00:15:10Z"
}
}