{"id":"GHSA-f2rp-38vg-j3gh","revision":"140437c6e4b345998a0ef6d63add87bd","records":[{"revision":"140437c6e4b345998a0ef6d63add87bd","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-f2rp-38vg-j3gh","aliases":["CVE-2021-21384"],"title":"Null characters not escaped","description":"### 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, \"\")`","state":0,"publishedAt":"2021-03-18T23:47:56+00:00","modifiedAt":"2026-09-10T03:49:01.9508352+00:00","affected":[{"ecosystem":"npm","name":"shescape","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"1.1.3"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:C/C:L/I:H/A:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"HIGH"}],"references":["https://github.com/ericcornelissen/shescape/security/advisories/GHSA-f2rp-38vg-j3gh","https://nvd.nist.gov/vuln/detail/CVE-2021-21384","https://github.com/ericcornelissen/shescape/commit/07a069a66423809cbedd61d980c11ca44a29ea2b","https://github.com/ericcornelissen/shescape/releases/tag/v1.1.3","https://www.npmjs.com/package/shescape"],"sourceUrl":"https://github.com/advisories/GHSA-f2rp-38vg-j3gh","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-f2rp-38vg-j3gh","identifiers":["GHSA-f2rp-38vg-j3gh","CVE-2021-21384"]},"retained":false,"historicalAffected":[]}],"coverage":[]}