deniz.in

Markets

Weather

Loading weather

· via dev.to (home feed)

BusyBox cpio hardlink flaw (CVE-2026-124744) bypasses path-traversal protection

BusyBox's cpio extractor sanitizes archive member paths but not hardlink targets, letting a crafted archive create links outside the extraction directory. Red Hat rates CVE-2026-124744 at 6.3 medium.

BusyBox cpio hardlink flaw (CVE-2026-124744) bypasses path-traversal protection

BusyBox's cpio extractor contains a path-traversal flaw that survives even with the project's dedicated traversal protection switched on. According to a technical write-up published on dev.to, the vulnerability — tracked as CVE-2026-124744 — arises because the extractor cleans up the visible path of each archive member but never applies the same scrutiny to hardlink targets. A crafted archive can consequently create a hardlink that resolves outside the directory the extraction was meant to stay within.

How the escape works

A hardlink is an extra name for a file that already exists, so the security-relevant operation during extraction is not only where a member lands in the tree but also which pre-existing path the link is permitted to point at. The dev.to post argues that defensive code frequently validates the visible filename while treating hardlink metadata as an internal detail — exactly the mistake BusyBox's cpio extractor made. If a privileged process honors a malicious hardlink target, it can modify files that fall outside anything the archive should have been able to touch. The real-world impact, the post notes, depends on the caller, the filesystem, which target files already exist, and whether the extraction process can reach them.

Severity rating

The Red Hat CVE record cited in the write-up scores the issue 6.3 medium, describing a local attack vector, high attack complexity, no privileges required, and required user interaction. An Ubuntu record covering the same CVE is also referenced.

The author cautions against reading that middling score as evidence that cpio extraction is generally safe. Build systems, firmware pipelines, container image assembly, backup restores, package installation and appliance update scripts routinely perform extraction under service accounts holding wide filesystem access. In those settings a path bug can rewrite configuration, damage application files or plant persistence.

Patching embedded systems

The straightforward fix is a patched BusyBox package from the operating system or appliance vendor. The complication is that embedded products often carry a private BusyBox build, so knowing the distribution package version settles nothing. The post advises cataloguing routers, cameras, industrial gateways, NAS boxes and recovery images that ship cpio, and adding BusyBox to the firmware bill of materials even when the device interface hides it — a version shown in a web UI or bundled with an update may not match what lives in the recovery partition or the cpio used on the factory line.

Mitigations where no patch exists

Where a vendor has not shipped a fix, the advice is to stop extracting untrusted archives with a privileged account. Extraction should run in a throwaway directory owned by an unprivileged account, on a filesystem holding nothing valuable. Hardlink creation can be disabled outright when the format permits it, or replaced with a parser that resolves and validates the target before any link is created. The extraction job should never sit in a directory writable by the same untrusted user who supplied the archive. For stronger isolation, the post proposes a dedicated mount namespace or container with the host mounted read-only and only an empty workspace writable.

Testing and containment

The write-up also urges teams to test archives rather than firmware versions alone: construct test archives holding a normal member, a member whose path contains ../, an absolute path, a hardlink pointing somewhere outside, and a hardlink chain, then run them under the exact service account used in production and confirm every rejected link fails closed. Logs should capture the archive name, submitter, extraction root and rejected link target, and a generic extraction failure should prompt preservation of the archive and its command line for investigation.

Hosts that already extracted a suspicious archive deserve a sweep for unexpected hardlinks, altered configuration and files owned by the extraction service outside the intended tree, with hashes checked against a known-good package or image. Affected files should be restored from trusted media, credentials stored in overwritten configuration rotated, and the host rebuilt if extraction ran with broad privileges and integrity is in doubt.

Why it matters

The bug demonstrates that extracting an archive involves deciding how far its contents may be trusted, and that the decision covers more than the visible filename. Sanitizing only the member path misses the other ways an archive can name a file, hardlinks among them, and BusyBox's own protection feature lent false comfort here. The moderate CVSS score also plays down the exposure in build and firmware pipelines, where extraction routinely runs with generous filesystem access. Finally, because embedded vendors ship private BusyBox builds, the usual "update the package" response may never reach the binary that actually matters, sitting in a recovery partition or factory image that nobody actively watches.

  • #busybox
  • #cpio
  • #security
  • #path-traversal
  • #cve
  • #embedded-systems

Related posts