/

CVE-2026-15816

Severity:

HIGH RISK

(7.5)

OS Command Injection (CWE-78) in dracut Emergency Hook

CVE-2026-15816

Awaiting Analysis

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Root-level Command Execution

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A command-injection flaw in dracut allows untrusted DHCP-derived data to be written into an emergency-hook shell script without adequate shell quoting. An attacker controlling a rogue DHCP server on an adjacent network may cause commands to execute with root privileges when the system later handles a boot failure and sources the hook.

Affected context

The issue occurs in dracut systems that:

  • Process DHCP-provided ROOT_PATH data during initramfs or network boot handling
  • Include that data in an error message generated by the die() function
  • Write the message into an emergency-hook shell script
  • Source the generated hook during subsequent boot-failure handling

Exploitability depends on the attacker being able to influence DHCP responses and the affected system later entering a code path that sources the generated emergency hook.

Exploit preconditions

  • Attack surface: Adjacent network through DHCP configuration delivery
  • Required access: Ability to operate or control a rogue DHCP server visible to the target
  • Trigger point: Creation and later sourcing of the dracut emergency-hook script during boot-failure handling
  • Why exploitation is possible: DHCP-derived content is incorporated into shell script text without sufficient quoting, allowing shell syntax to be interpreted when the hook is sourced

Why this happens

The underlying bug is improper neutralization of externally controlled data before it is embedded in a shell script. dracut's error-handling path places a message containing DHCP-derived ROOT_PATH data into an emergency-hook file, but does not apply shell-safe quoting or treat the value strictly as data.

This maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, because attacker-influenced input can alter the behavior of a shell script when it is interpreted.

Potential impact

  • An attacker may execute arbitrary commands with root privileges
  • The initramfs or early-boot environment could be compromised
  • System confidentiality, integrity, and availability could be affected
  • Persistence or additional compromise may be possible depending on the boot environment and available privileges

General mitigation guidance

Mitigation generally focuses on keeping externally supplied values out of executable shell context and reducing trust in network-provided configuration.

Common defensive patterns include:

  • Treating DHCP-derived values strictly as data rather than shell source
  • Applying context-appropriate shell escaping when script generation cannot be avoided
  • Using structured data or fixed command arguments instead of dynamically generated shell code
  • Validating and constraining network-provided path values before use
  • Limiting when emergency hooks are generated and sourced
  • Running early-boot components with only the privileges and capabilities they require
  • Applying network controls that reduce exposure to unauthorized DHCP servers

How teams detect issues like this

Detection approaches can include:

  • Static analysis rules for concatenating external input into shell scripts or command strings
  • Code review checks for generated initramfs hooks and unquoted shell variables
  • Searches for error-handling functions that write user- or network-controlled content to executable files
  • Policy enforcement requiring shell-safe quoting and structured process APIs
  • Runtime monitoring for unexpected DHCP infrastructure, modified initramfs hook files, or unusual commands executed during early boot

Automated code-review and security-scanning tools may help identify shell injection patterns, but findings should be validated against the actual boot and sourcing paths.

Sources

SourceLink
access.redhat.comaccess.redhat.com/errata/RHSA-2026:54571
access.redhat.comaccess.redhat.com/errata/RHSA-2026:54575
access.redhat.comaccess.redhat.com/errata/RHSA-2026:54576
access.redhat.comaccess.redhat.com/errata/RHSA-2026:57580
access.redhat.comaccess.redhat.com/errata/RHSA-2026:57772
access.redhat.comaccess.redhat.com/errata/RHSA-2026:57775
access.redhat.comaccess.redhat.com/errata/RHSA-2026:57785
access.redhat.comaccess.redhat.com/errata/RHSA-2026:60440
access.redhat.comaccess.redhat.com/errata/RHSA-2026:60445
access.redhat.comaccess.redhat.com/errata/RHSA-2026:61252
access.redhat.comaccess.redhat.com/errata/RHSA-2026:62269
access.redhat.comaccess.redhat.com/errata/RHSA-2026:62409
access.redhat.comaccess.redhat.com/errata/RHSA-2026:62549
access.redhat.comaccess.redhat.com/errata/RHSA-2026:63041
access.redhat.comaccess.redhat.com/errata/RHSA-2026:63044
access.redhat.comaccess.redhat.com/errata/RHSA-2026:65839
access.redhat.comaccess.redhat.com/errata/RHSA-2026:65851
access.redhat.comaccess.redhat.com/errata/RHSA-2026:66357
access.redhat.comaccess.redhat.com/errata/RHSA-2026:67857
access.redhat.comaccess.redhat.com/errata/RHSA-2026:69118
access.redhat.comaccess.redhat.com/errata/RHSA-2026:69119
access.redhat.comaccess.redhat.com/errata/RHSA-2026:70586
access.redhat.comaccess.redhat.com/errata/RHSA-2026:70615
access.redhat.comaccess.redhat.com/errata/RHSA-2026:74499
access.redhat.comaccess.redhat.com/errata/RHSA-2026:79114
access.redhat.comaccess.redhat.com/errata/RHSA-2026:90272
access.redhat.comaccess.redhat.com/security/cve/CVE-2026-15816
bugzilla.redhat.combugzilla.redhat.com/show_bug.cgi?id=2459963
bugzilla.redhat.combugzilla.redhat.com/show_bug.cgi?id=2500889
github.comgithub.com/dracutdevs/dracut/blob/master/modules.d/40network/netroot.sh
github.comgithub.com/dracutdevs/dracut/blob/master/modules.d/99base/dracut-lib.sh

Frequently asked

questions

It may be exploitable over an adjacent network when a target accepts DHCP responses from an attacker-controlled or rogue DHCP server. Exploitation also depends on the affected boot-failure and emergency-hook execution paths being reached.

Local login access is not necessarily required. The important prerequisite is the ability to influence DHCP data that the target processes, typically from a network position where the rogue DHCP server can serve the system.

The safest pattern is to prevent network-derived values from becoming executable shell text. Where scripting is unavoidable, use strict validation and context-appropriate shell escaping, preferably replacing generated shell code with structured operations.

Treat DHCP and other network-provided configuration as untrusted, review all generated shell scripts, enforce secure shell-quoting policies, restrict unauthorized DHCP services, and monitor changes to early-boot and initramfs components.

Find out what's already
exploitable in your codebase.