CVE Vulnerabilities

CVE-2022-24903

Improper Validation of Specified Quantity in Input

Published: May 06, 2022 | Modified: Nov 07, 2023
CVSS 3.x
8.1
HIGH
Source:
NVD
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS 2.x
6.8 MEDIUM
AV:N/AC:M/Au:N/C:P/I:P/A:P
RedHat/V2
RedHat/V3
8.1 IMPORTANT
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Ubuntu
MEDIUM

Rsyslog is a rocket-fast system for log processing. Modules for TCP syslog reception have a potential heap buffer overflow when octet-counted framing is used. This can result in a segfault or some other malfunction. As of our understanding, this vulnerability can not be used for remote code execution. But there may still be a slight chance for experts to do that. The bug occurs when the octet count is read. While there is a check for the maximum number of octets, digits are written to a heap buffer even when the octet count is over the maximum, This can be used to overrun the memory buffer. However, once the sequence of digits stop, no additional characters can be added to the buffer. In our opinion, this makes remote exploits impossible or at least highly complex. Octet-counted framing is one of two potential framing modes. It is relatively uncommon, but enabled by default on receivers. Modules imtcp, imptcp, imgssapi, and imhttp are used for regular syslog message reception. It is best practice not to directly expose them to the public. When this practice is followed, the risk is considerably lower. Module imdiag is a diagnostics module primarily intended for testbench runs. We do not expect it to be present on any production installation. Octet-counted framing is not very common. Usually, it needs to be specifically enabled at senders. If users do not need it, they can turn it off for the most important modules. This will mitigate the vulnerability.

Weakness

The product receives input that is expected to specify a quantity (such as size or length), but it does not validate or incorrectly validates that the quantity has the required properties.

Affected Software

Name Vendor Start Version End Version
Rsyslog Rsyslog * 8.2204.1 (excluding)
Red Hat Enterprise Linux 6 Extended Lifecycle Support RedHat rsyslog-0:5.8.10-12.el6_10.1 *
Red Hat Enterprise Linux 6 Extended Lifecycle Support RedHat rsyslog7-0:7.4.10-7.el6_10.1 *
Red Hat Enterprise Linux 7 RedHat rsyslog-0:8.24.0-57.el7_9.3 *
Red Hat Enterprise Linux 8 RedHat rsyslog-0:8.2102.0-7.el8_6.1 *
Red Hat Enterprise Linux 8.1 Update Services for SAP Solutions RedHat rsyslog-0:8.37.0-13.el8_1.1 *
Red Hat Enterprise Linux 8.2 Extended Update Support RedHat rsyslog-0:8.1911.0-3.el8_2.1 *
Red Hat Enterprise Linux 8.4 Extended Update Support RedHat rsyslog-0:8.1911.0-7.el8_4.3 *
Red Hat Enterprise Linux 9 RedHat rsyslog-0:8.2102.0-101.el9_0.1 *
Red Hat Virtualization 4 for Red Hat Enterprise Linux 7 RedHat rsyslog-0:8.24.0-57.el7_9.3 *
Red Hat Virtualization 4 for Red Hat Enterprise Linux 7 RedHat redhat-virtualization-host-0:4.3.23-20220622.0.el7_9 *
Red Hat Virtualization 4 for Red Hat Enterprise Linux 8 RedHat redhat-virtualization-host-0:4.5.0-202205291010_8.6 *
Red Hat Virtualization Engine 4.3 RedHat rsyslog-0:8.24.0-57.el7_9.3 *
Rsyslog Ubuntu bionic *
Rsyslog Ubuntu devel *
Rsyslog Ubuntu esm-infra/xenial *
Rsyslog Ubuntu focal *
Rsyslog Ubuntu impish *
Rsyslog Ubuntu jammy *
Rsyslog Ubuntu kinetic *
Rsyslog Ubuntu lunar *
Rsyslog Ubuntu mantic *
Rsyslog Ubuntu noble *
Rsyslog Ubuntu oracular *
Rsyslog Ubuntu trusty/esm *
Rsyslog Ubuntu upstream *

Extended Description

Specified quantities include size, length, frequency, price, rate, number of operations, time, and others. Code may rely on specified quantities to allocate resources, perform calculations, control iteration, etc. When the quantity is not properly validated, then attackers can specify malicious quantities to cause excessive resource allocation, trigger unexpected failures, enable buffer overflows, etc.

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