CVE-2018-3738: Protobufjs Denial of Service Vulnerability
MODERATECVE-2018-3738 is a MODERATE (CVSS 5.5) denial of service vulnerability (CWE-1333: Inefficient Regular Expression Complexity) affecting Protobufjs libraries in the npm ecosystem. The issue involves denial of service in protobufjs. Remediation is available by upgrading affected packages to version 6.8.6, 5.0.3.
CVE-2018-3738 at a Glance
Security Impact
CVSS: 5.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H).
How to Fix CVE-2018-3738
To remediate this vulnerability, upgrade all affected Protobufjs 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 protobufjs@6.8.6
npm install protobufjs@5.0.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls protobufjs
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2018-3738, inspect your project dependencies using npm:
npm ls protobufjs
Analyze the terminal output to locate any version of Protobufjs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.8.6), your application is affected.
Note: The npm ls protobufjs 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 Protobufjs, 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-2018-3738 Affected Protobufjs Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
protobufjs
|
npm |
≥ 6.0.0
< 6.8.6
|
6.8.6
|
|
protobufjs
|
npm |
< 5.0.3
|
5.0.3
|
References
Frequently Asked Questions
What is CVE-2018-3738?
Which Protobufjs versions are affected?
What version fixes CVE-2018-3738?
Is protobufjs affected?
What is the CVSS score of CVE-2018-3738?
What CWE is associated with CVE-2018-3738?
How can I check npm dependencies for CVE-2018-3738?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-762f-c2wg-m8c8",
"modified" : "2023-04-11T00:32:09Z",
"published" : "2018-10-09T00:27:15Z",
"aliases" : [ "CVE-2018-3738" ],
"summary" : "Denial of Service in protobufjs",
"details" : "Versions of `protobufjs` before 5.0.3 and 6.8.6 are vulnerable to a regular expression denial of service when parsing crafted invalid *.proto files.\n\n\n## Recommendation\n\nUpdate to version 5.0.3, 6.8.6 or later.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "protobufjs"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "6.0.0"
}, {
"fixed" : "6.8.6"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "protobufjs"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "5.0.3"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-3738"
}, {
"type" : "WEB",
"url" : "https://hackerone.com/reports/319576"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-762f-c2wg-m8c8"
}, {
"type" : "WEB",
"url" : "https://github.com/dcodeIO/protobuf.js/blob/6.8.5/src/parse.js#L27"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/advisories/605"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1333" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2020-06-16T21:21:32Z",
"nvd_published_at" : "2018-06-07T02:29:00Z"
}
}