CVE Vulnerabilities

CVE-2024-32487

Improper Neutralization of Directives in Statically Saved Code ('Static Code Injection')

Published: Apr 13, 2024 | Modified: Nov 21, 2024
CVSS 3.x
N/A
Source:
NVD
CVSS 2.x
RedHat/V2
RedHat/V3
8.6 IMPORTANT
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
Ubuntu
MEDIUM

less through 653 allows OS command execution via a newline character in the name of a file, because quoting is mishandled in filename.c. Exploitation typically requires use with attacker-controlled file names, such as the files extracted from an untrusted archive. Exploitation also requires the LESSOPEN environment variable, but this is set by default in many common cases.

Weakness

The product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes code syntax before inserting the input into an executable resource, such as a library, configuration file, or template.

Affected Software

Name Vendor Start Version End Version
Red Hat Enterprise Linux 7 RedHat less-0:458-10.el7_9 *
Red Hat Enterprise Linux 8 RedHat less-0:530-3.el8_10 *
Red Hat Enterprise Linux 8.2 Advanced Update Support RedHat less-0:530-2.el8_2 *
Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update Support RedHat less-0:530-2.el8_4 *
Red Hat Enterprise Linux 8.4 Telecommunications Update Service RedHat less-0:530-2.el8_4 *
Red Hat Enterprise Linux 8.4 Update Services for SAP Solutions RedHat less-0:530-2.el8_4 *
Red Hat Enterprise Linux 8.6 Advanced Mission Critical Update Support RedHat less-0:530-3.el8_6 *
Red Hat Enterprise Linux 8.6 Telecommunications Update Service RedHat less-0:530-3.el8_6 *
Red Hat Enterprise Linux 8.6 Update Services for SAP Solutions RedHat less-0:530-3.el8_6 *
Red Hat Enterprise Linux 8.8 Extended Update Support RedHat less-0:530-3.el8_8 *
Red Hat Enterprise Linux 9 RedHat less-0:590-4.el9_4 *
Red Hat Enterprise Linux 9.0 Update Services for SAP Solutions RedHat less-0:590-2.el9_0 *
Red Hat Enterprise Linux 9.2 Extended Update Support RedHat less-0:590-3.el9_2 *
Less Ubuntu devel *
Less Ubuntu esm-infra/bionic *
Less Ubuntu esm-infra/xenial *
Less Ubuntu focal *
Less Ubuntu jammy *
Less Ubuntu mantic *
Less Ubuntu noble *
Less Ubuntu trusty/esm *
Less Ubuntu upstream *

Potential Mitigations

  • Assume all input is malicious. Use an “accept known good” input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.
  • When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, “boat” may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as “red” or “blue.”
  • Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code’s environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.

References