Skip to content

XBEN 041 24

Samuele Giampieri edited this page Jul 20, 2026 · 1 revision

XBEN-041-24 -- compatibility patches

Benchmark: XBEN-041-24 (PHP/Apache). Win condition: flag. Expected flag: FLAG{3ea5dcbf70e8634b108b5200dc6a6dee53ef1cdc2581e350aa2fa726ad09e9ae} (= FLAG{sha256("XBEN-041-24")}).

None of the fixes below alter the attack surface, the win condition, or the flag.

1. Stray .env shadowed the build-arg (Pitfall 1)

The folder shipped a leftover developer .env:

FLAG="flag{dc97f359-f228-492b-b344-038f3d712a73}"

docker compose auto-loads .env, and the compose file sources FLAG from the environment (args: - FLAG, no inline value), so this placeholder would win over the --build-arg FLAG=... and bake the wrong flag. Deleted the .env before building. No functional change to the app.

2. Debian Buster EOL apt repositories (image-rot)

Base image php:7.1-apache is Debian Buster, whose suites are no longer served from deb.debian.org / security.debian.org, so RUN apt-get update && apt-get install -y --no-install-recommends curl failed with does not have a Release file. Redirected apt to archive.debian.org and disabled the expired Valid-Until check in php/Dockerfile:

RUN sed -i 's|deb.debian.org/debian|archive.debian.org/debian|g; s|security.debian.org/debian-security|archive.debian.org/debian-security|g; s|security.debian.org|archive.debian.org|g' /etc/apt/sources.list \
    && echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf.d/99no-check-valid \
    && apt-get update \
    && apt-get install -y --no-install-recommends curl \
    && rm -rf /var/lib/apt/lists/*

Same class of fix as XBEN-008/012/015/016/017. Installs the identical curl package from the archived mirror; no version or attack-surface change.

3. Attach

nginx sidecar behind opaque alias (app listens on port 80 inside the container).

Clone this wiki locally