{"id":"CVE-2021-21384","aliases":["CVE-2021-21384","GHSA-f2rp-38vg-j3gh"],"related":[],"kind":"vulnerability","state":"published","title":"Null characters not escaped in shescape","summary":"shescape is a simple shell escape package for JavaScript. In shescape before version 1.1.3, anyone using _Shescape_ to defend against shell injection may still be vulnerable against shell injection if the attacker manages to insert a into the payload. For an example see the referenced GitHub Security Advisory. The problem has been patched in version 1.1.3. No further changes are required.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"shescape is a simple shell escape package for JavaScript. In shescape before version 1.1.3, anyone using _Shescape_ to defend against shell injection may still be vulnerable against shell injection if the attacker manages to insert a into the payload. For an example see the referenced GitHub Security Advisory. The problem has been patched in version 1.1.3. No further changes are required.","source":"cvelist"},{"lang":"en","text":"### Impact\n\nAnyone using _Shescape_ to defend against shell injection may still be vulnerable against shell injection if the attacker manages to insert a [null character](https://en.wikipedia.org/wiki/Null_character) into the payload. For example (on Windows):\n\n```javascript\nconst cp = require(\"child_process\");\nconst shescape = require(\"shescape\");\n\nconst nullChar = String.fromCharCode(0);\nconst payload = \"foo\\\" && ls -al ${nullChar} && echo \\\"bar\";\nconsole.log(cp.execSync(`echo ${shescape.quote(payload)}`));\n// foototal 3\n// drwxr-xr-x 1 owner XXXXXX      0 Mar 13 18:44 .\n// drwxr-xr-x 1 owner XXXXXX      0 Mar 13 00:09 ..\n// drwxr-xr-x 1 owner XXXXXX      0 Mar 13 18:42 folder                                                                 \n// -rw-r--r-- 1 owner XXXXXX      0 Mar 13 18:42 file\n```\n\n### Patches\n\nThe problem has been patched in [v1.1.3](https://github.com/ericcornelissen/shescape/releases/tag/v1.1.3) which you can upgrade to now. No further changes are required.\n\n### Workarounds\n\nAlternatively, null characters can be stripped out manually using e.g. `arg.replace(/\\u{0}/gu, \"\")`","format":"markdown","source":"ghsa"},{"lang":"es","text":"shescape es un paquete de escape de shell simple para JavaScript.&#xa0;En shescape versiones anteriores a 1.1.3, cualquiera que use _Shescape_ para defenderse de la inyección de shell puede ser vulnerable frente a una inyección shell si el atacante logra insertar en la carga útil.&#xa0;Para visualizar un ejemplo, consulte el Aviso de Seguridad de GitHub al que se hace referencia.&#xa0;El problema ha sido solucionado en la versión 1.1.3.&#xa0;No son requeridos más cambios","source":"nvd"}],"published":"2021-03-18T23:47:56.000Z","modified":"2026-09-10T03:49:01.950Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:C/C:L/I:H/A:N","score":6.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:C/C:L/I:H/A:N","score":6.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:C/C:L/I:H/A:N","score":6.3,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:L/AC:L/Au:N/C:P/I:P/A:P","score":4.6,"rating":"MEDIUM"}],"cwes":["CWE-88"],"affected":[{"ranges":[{"version":"< 1.1.3","status":"affected"}],"vendor":"ericcornelissen","product":"shescape","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.1.3"}],"ecosystem":"npm","package":"shescape","purl":"pkg:npm/shescape","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"1.1.3"}],"vendor":"shescape_project","product":"shescape","cpe":"cpe:2.3:a:shescape_project:shescape:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/ericcornelissen/shescape/security/advisories/GHSA-f2rp-38vg-j3gh","tags":["exploit","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/ericcornelissen/shescape/commit/07a069a66423809cbedd61d980c11ca44a29ea2b","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/ericcornelissen/shescape/releases/tag/v1.1.3","tags":["release-notes","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://www.npmjs.com/package/shescape","tags":["product","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-21384","tags":["advisory"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-21384","url":"https://www.cve.org/CVERecord?id=CVE-2021-21384","licence":"CVE Terms of Use","modified":"2024-08-03T18:09:15.790Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-f2rp-38vg-j3gh","url":"https://github.com/advisories/GHSA-f2rp-38vg-j3gh","licence":"CC-BY-4.0","modified":"2026-09-10T03:49:01.950Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-21384","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-21384","licence":"Public domain","modified":"2026-06-17T03:35:27.620Z"}],"updatedAt":"2026-11-25T22:58:00.336Z","epss":{"score":0.00573,"percentile":0.48708,"date":"2026-12-01T12:00:22.000Z"}}