Null characters not escaped
High severity
GitHub Reviewed
Published
Mar 13, 2021
in
ericcornelissen/shescape
•
Updated Feb 1, 2023
Description
Reviewed
Mar 18, 2021
Published to the GitHub Advisory Database
Mar 18, 2021
Published by the National Vulnerability Database
Mar 19, 2021
Last updated
Feb 1, 2023
Impact
Anyone using Shescape to defend against shell injection may still be vulnerable against shell injection if the attacker manages to insert a null character into the payload. For example (on Windows):
Patches
The problem has been patched in v1.1.3 which you can upgrade to now. No further changes are required.
Workarounds
Alternatively, null characters can be stripped out manually using e.g.
arg.replace(/\u{0}/gu, "")
References