CVE-2022-49846

Description

A flaw was found in the Linux kernel's Universal Disk Format (UDF) file system. An out-of-bounds memory write occurs due to an incorrect buffer size calculation when processing long filenames. A local user capable of mounting file systems can trigger this issue by mounting a crafted UDF image and accessing or creating files with specially constructed long names. This flaw leads to kernel memory corruption, potentially allowing privilege escalation or causing a Denial of Service (DoS) via a system crash.

Statement

An undersized heap allocation in udf_find_entry can cause a slab out of bounds write when a crafted UDF directory entry makes the name copy length reach 255 bytes while copy_name has space for only 254 bytes. The write occurs during pathname lookup or file open processing on the mounted UDF filesystem. A local attacker may trigger a kernel crash and the confirmed heap overwrite creates a plausible risk of broader kernel memory corruption, including potential confidentiality or integrity impact, although reliable privilege escalation is not demonstrated. For the CVSS the PR:L value is used for the paranoid score because a low privileged local user may trigger lookup after a malicious UDF image has already been mounted by an automount service or another privileged component. Mounting an arbitrary image directly normally requires administrative privileges, which is reflected by PR:H in the base score. The issue is not directly network reachable. Impact is at least a local denial of service via kernel crash and in the worst defensible case may include privilege escalation through kernel heap corruption.

Mitigation

To mitigate this issue, prevent module udf from being loaded. Please see https://access.redhat.com/solutions/41278 for how to blacklist a kernel module to prevent it from loading automatically.

Common Vulnerability Scoring System (CVSS) Score Details

Info alert:Important note

CVSS scores for open source components depend on vendor-specific factors (e.g. version or build chain). Therefore, Red Hat's score and impact rating can be different from NVD and other vendors. Red Hat remains the authoritative CVE Naming Authority (CNA) source for its products and services (see Red Hat classifications).

CVSS v3 Score Breakdown

Red HatNVDcve.org
Base Score7.87.87.8
Attack VectorLocalLocalLocal
Attack ComplexityLowLowLow
Privileges RequiredLowLowLow
User InteractionNoneNoneNone
ScopeUnchangedUnchangedUnchanged
ConfidentialityHighHighHigh
Integrity ImpactHighHighHigh
Availability ImpactHighHighHigh

Vector

Red Hat: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

NVD: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

cve.org: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Understanding the Weakness (CWE)

Integrity

Technical Impact: Modify Memory; Execute Unauthorized Code or Commands

Write operations could cause memory corruption. In some cases, an adversary can modify control data such as return addresses in order to execute unexpected code.

Availability

Technical Impact: DoS: Crash, Exit, or Restart

Attempting to access out-of-range, invalid, or unauthorized memory could cause the product to crash.

Other

Technical Impact: Unexpected State

Subsequent write operations can produce undefined or unexpected results.

Frequently Asked Questions

Want to get errata notifications? Sign up here.