Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2025-24965

CVE-2025-24965: crun Path Traversal Vulnerability

CVE-2025-24965 is a path traversal flaw in crun OCI Container Runtime that allows malicious containers to escape the root filesystem and modify host files. This article covers technical details, affected versions, and mitigation.

Published:

CVE-2025-24965 Overview

CVE-2025-24965 is a path traversal vulnerability [CWE-22] in crun, an open source Open Container Initiative (OCI) container runtime written in C. The flaw resides in the krun handler, which processes container images destined for the libkrun virtualization backend. A malicious container image can trick the handler into escaping the container root filesystem and writing files on the host. The attacker needs only the ability of the current user to write to the target file, with no elevated permissions required. The issue is fixed in crun version 1.20.

Critical Impact

A crafted container image can break out of the root filesystem boundary and create or modify arbitrary files on the host, leading to container escape and potential host compromise.

Affected Products

  • crun OCI container runtime versions prior to 1.20
  • Container platforms using crun with the krun handler enabled (Podman, CRI-O deployments)
  • Linux distributions shipping vulnerable crun builds

Discovery Timeline

  • 2025-02-19 - CVE-2025-24965 published to the National Vulnerability Database
  • 2026-04-15 - Last updated in NVD database

Technical Details for CVE-2025-24965

Vulnerability Analysis

The vulnerability is a path traversal weakness in the krun handler within crun. When crun processes a container image targeted at the libkrun backend, the handler performs file operations using paths derived from the container image contents. The handler does not properly constrain those paths to the container root, allowing references that resolve outside of it. An attacker who supplies a crafted image can therefore direct file creation or modification to arbitrary locations on the host. The required privilege level is limited to whatever the invoking user already possesses on the host filesystem.

Root Cause

The root cause is insufficient validation and canonicalization of filesystem paths inside the krun handler before write operations occur. Path components originating from an untrusted container image are joined and used without enforcing that the resulting path remains within the container rootfs. The upstream fix in commit 0aec82c2b686f0b1793deed43b46524fe2e8b5a7 corrects this boundary enforcement. Full remediation details are published in the GitHub Security Advisory GHSA-f42g-r5jj-qh4j.

Attack Vector

Exploitation requires the victim to pull and run a malicious container image processed by the krun handler. User interaction is required to initiate the container, but no special privileges beyond the current user's existing file write access are needed. Once the image is processed, the handler writes attacker-controlled content to a host path of the attacker's choosing. Targets include user configuration files, shell profiles, or any file the running user can modify, enabling persistence or privilege escalation chains.

No verified public exploit code is currently available. The vulnerability mechanism is described in prose; see the GitHub commit fix for the corrective patch.

Detection Methods for CVE-2025-24965

Indicators of Compromise

  • Unexpected file creation or modification on the host filesystem coinciding with container pull or run operations using crun.
  • Container images from untrusted registries referencing the libkrun runtime handler.
  • Anomalous writes to user dotfiles, shell startup scripts, or SSH authorized_keys files initiated by container runtime processes.

Detection Strategies

  • Audit crun invocations and compare the version reported by crun --version against the fixed release 1.20.
  • Monitor file integrity on directories outside container storage paths that are written to by crun or its child processes.
  • Inspect container image manifests and filesystem layers for entries with traversal sequences such as ../ in path names.

Monitoring Recommendations

  • Enable Linux audit rules (auditd) on user home directories and system configuration paths to flag writes originating from container runtime PIDs.
  • Collect container runtime logs and forward them to a centralized analytics platform for correlation with image pull events.
  • Track use of the krun handler specifically and alert when it is invoked with images from unverified sources.

How to Mitigate CVE-2025-24965

Immediate Actions Required

  • Upgrade crun to version 1.20 or later on every host running container workloads.
  • Restrict container image sources to trusted, signed registries and block pulls from arbitrary public sources.
  • Audit recent container runs that used the krun handler and review the host filesystem for unauthorized modifications.

Patch Information

The vulnerability is fixed in crun 1.20, available from the GitHub Release v1.20. The corrective code change is published in commit 0aec82c2b686f0b1793deed43b46524fe2e8b5a7. Distribution maintainers have backported the fix into stable channels; verify the installed package version on each host.

Workarounds

  • No workarounds are available per the upstream advisory; upgrading to crun 1.20 is the only supported remediation.
  • As an interim risk reduction, avoid running container images from untrusted sources with the krun handler until patching is complete.
bash
# Verify installed crun version and upgrade where needed
crun --version

# Debian/Ubuntu
sudo apt update && sudo apt install --only-upgrade crun

# Fedora/RHEL
sudo dnf upgrade crun

# Confirm the version is 1.20 or later
crun --version | grep -E 'crun version (1\.20|1\.[2-9][0-9]|[2-9])'

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.