CVE-2019-5786: Puppeteer Use-After-Free Vulnerability
MODERATECVE-2019-5786 is a MODERATE (CVSS 6.5) use-after-free vulnerability (CWE-416: Use After Free) affecting Puppeteer libraries in the npm ecosystem. The issue involves use-after-free in puppeteer. Remediation is available by upgrading affected packages to version 1.13.0.
CVE-2019-5786 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H).
How to Fix CVE-2019-5786
To remediate this vulnerability, upgrade all affected Puppeteer 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 puppeteer@1.13.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls puppeteer
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2019-5786, inspect your project dependencies using npm:
npm ls puppeteer
Analyze the terminal output to locate any version of Puppeteer in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.13.0), your application is affected.
Note: The npm ls puppeteer 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-416: Use After Free, where the product reuses or references memory after it has been freed. at some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer. In Puppeteer, 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-2019-5786 Affected Puppeteer Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
puppeteer
|
npm |
< 1.13.0
|
1.13.0
|
References
Frequently Asked Questions
What is CVE-2019-5786?
Which Puppeteer versions are affected?
What version fixes CVE-2019-5786?
Is puppeteer affected?
What is the CVSS score of CVE-2019-5786?
What CWE is associated with CVE-2019-5786?
How can I check npm dependencies for CVE-2019-5786?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-c2gp-86p4-5935",
"modified" : "2021-09-27T16:20:33Z",
"published" : "2020-09-02T18:25:43Z",
"aliases" : [ "CVE-2019-5786" ],
"summary" : "Use-After-Free in puppeteer",
"details" : "Versions of `puppeteer` prior to 1.13.0 are vulnerable to the Use-After-Free vulnerability in Chromium (CVE-2019-5786). The Chromium FileReader API is vulnerable to Use-After-Free which may lead to Remote Code Execution.\n\n\n## Recommendation\n\nUpgrade to version 1.13.0 or later.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "puppeteer"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.13.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-5786"
}, {
"type" : "WEB",
"url" : "https://github.com/GoogleChrome/puppeteer/issues/4141"
}, {
"type" : "WEB",
"url" : "https://blog.exodusintel.com/2019/03/20/cve-2019-5786-analysis-and-exploitation"
}, {
"type" : "WEB",
"url" : "https://chromereleases.googleblog.com/2019/03/stable-channel-update-for-desktop.html"
}, {
"type" : "WEB",
"url" : "https://crbug.com/936448"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/GoogleChrome/puppeteer"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/SNYK-JS-PUPPETEER-174321"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/advisories/824"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-416" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2020-08-31T18:37:09Z",
"nvd_published_at" : "2019-06-27T17:15:13Z"
}
}