PT-2021-23668 · Unknown+1 · Shell-Quote+1

CVE-2021-42740

·

Published

2021-10-21

·

Updated

2026-08-24

CVSS v3.1

9.8

Critical

VectorAV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Name of the Vulnerable Software and Affected Versions shell-quote versions prior to 1.7.3
Description The issue allows command injection. An attacker can inject unescaped shell metacharacters through a regex designed to support Windows drive letters. If the output of this package is passed to a real shell as a quoted argument to a command with exec(), an attacker can inject arbitrary commands. This is because the Windows drive letter regex character class is [A-z] instead of the correct [A-Za-z]. Several shell metacharacters exist in the space between capital letter Z and lower case letter a, such as the backtick character.
Recommendations For versions prior to 1.7.3, update to version 1.7.3 or later to resolve the issue. As a temporary workaround, consider restricting the use of the exec() function with output from the shell-quote package until a patch is available. Avoid passing unvalidated input to the exec() function to minimize the risk of exploitation.

Fix

Command Injection

Found an issue in the description? Have something to add? Feel free to write us 👾

Weakness Enumeration

Related Identifiers

CVE-2021-42740
GHSA-G4RG-993R-MGX7
SUSE-SU-2022:3313-1
SUSE-SU-2022:3314-1
SUSE-SU-2022:3761-1
SUSE-SU-2023:0592-1

Affected Products

Suse
Shell-Quote