Skip to content

Disable APT retries on the remaining networked APT paths - #337

Merged
rmcdaniel merged 1 commit into
mainfrom
general/295b-apt-no-retries
Nov 13, 2026
Merged

rmcdaniel merged 1 commit into
mainfrom
general/295b-apt-no-retries

Conversation

@rmcdaniel

Copy link
Copy Markdown
Member

Part of durable-workflow/.github#295 (CVE-2026-109518: APT follows a redirect on retry, then installs a swapped package as root).

An org-wide inventory of networked APT calls found these sample-app paths with neither fixed apt nor retries off:

Path Context Why it wasn't covered
polyglot/laravel/Dockerfile image build (polyglot validation) php:8.4-cli, unpinned
polyglot/php_worker/Dockerfile image build php:8.4-cli, unpinned
polyglot/rust_worker/Dockerfile (runtime stage) image build debian:bookworm-slim, unpinned
ci.yml test, microservice-test; composer-lock-audit.yml; playground-journeys.yml hosted runner shivammathur/setup-php can run apt-get (repair/extension paths)
sdk-children.yml hosted runner playwright install --with-deps runs sudo apt-get

Change: each of these writes Acquire::Retries "0"; to /etc/apt/apt.conf.d/99-no-retries before its first APT-capable step. That's a RUN line in the images and a step in the jobs. Same pattern as cli#121, waterline#300 and cloud#758.

Already protected and unchanged: the root Dockerfile, .devcontainer/docker/Dockerfile and polyglot/python_worker/Dockerfile. They run the central require-fixed-bookworm-apt.sh guard on parents pinned by digest (php:8.4.27-cli-bookworm@b3e907a1…, which has apt 2.6.2).

Test: new tests/Unit/AptNoRetriesContractTest.php checks two things:

  • every workflow job has the no-retries line before its first setup-php or networked-APT step;
  • every image stage has that line or the fixed-APT guard before its first apt-get, --with-deps or Brotli install-vendor.sh.

Controls show the checks catch a late or missing line. I ran it locally in composer:2.11.0: 4 tests pass, and it reports all 8 paths above when the fix is reverted. The central qualification_policy.py validate also passes on the changed workflows.

🤖 Generated with Claude Code

Three polyglot images run networked apt-get on unpinned parents
(php:8.4-cli twice, debian:bookworm-slim), so their APT version is not
verifiable. Four workflow jobs run shivammathur/setup-php, which can call
apt-get itself, and sdk-children runs playwright install --with-deps on
the hosted runner. Write Acquire::Retries "0" before the first networked
APT step in each, so the retry-after-redirect precondition of
CVE-2026-109518 is absent (as in cli#121, waterline#300, cloud#758).

The root and devcontainer images and the Python worker already run the
central fixed-Bookworm-APT guard on pinned parents and are unchanged.
AptNoRetriesContractTest now requires one protection or the other before
APT in every workflow job and image stage.

Refs durable-workflow/.github#295

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rmcdaniel rmcdaniel added the agent:general Pull request opened by General agent label Nov 13, 2026
@sonarqubecloud

Copy link
Copy Markdown

@rmcdaniel

Copy link
Copy Markdown
Member Author

Security PASS at 85f66ec (.github#295). Guards precede every setup-php and playwright --with-deps job. The polyglot laravel and php_worker images, and the rust_worker runtime stage, write Acquire::Retries "0"; before their first apt call. The root, devcontainer and python_worker images keep the existing central require-fixed-bookworm-apt.sh on digest-pinned parents. That's the agreed "pin to a fixed parent" alternative, and the new test accepts it. The test fails when the fix is reverted. Note: its Dockerfile list is hard-coded, so add any new Dockerfile to it.

@rmcdaniel
rmcdaniel merged commit f37d174 into main Nov 13, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent:general Pull request opened by General agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant