Skip to content

fix(xhgui): upgrade Alpine packages so the image gets PHP and nginx security fixes - #9028

Merged
rfay merged 1 commit into
ddev:mainfrom
rfay:20261028_rfay_xhgui_apk_upgrade
Oct 30, 2026
Merged

rfay merged 1 commit into
ddev:mainfrom
rfay:20261028_rfay_xhgui_apk_upgrade

Conversation

@rfay

@rfay rfay commented Oct 28, 2026

Copy link
Copy Markdown
Member

Short Summary (TL;DR)

The ddev-xhgui image shipped PHP 8.3.23 from July 2025, because upstream xhgui/xhgui:0.23 has not been rebuilt since then. The Dockerfile now runs apk upgrade, so each DDEV image build picks up current Alpine 3.22 security fixes. The risk from the old packages is low, but there is no reason to ship them.

The Issue

Upstream built xhgui/xhgui:0.23 on 2025-07-07 on Alpine 3.22.0. Our Dockerfile only ran apk add, so every DDEV release shipped that package set unchanged: PHP 8.3.23, nginx 1.28.0, OpenSSL 3.5.0, and 33 outdated packages in total. Security scanners flag the image, even though DDEV v1.25.5 delivered current PHP in the web image.

Why the risk is low

  • Not exposed beyond the local machine. By default, the router and the optional host port bind xhgui to 127.0.0.1. Only processes on the developer's own machine can reach it. Exposure needs an explicit choice, such as bind_all_interfaces: true or ddev share.
  • xhgui runs PHP as php-fpm behind nginx. No recent PHP advisory has yet been shown to affect php-fpm in this setup.
  • xhgui has no authentication anyway. Anyone who can reach it can already read and delete profiles. An old PHP adds little to that for a local-only service.

The fix is still worthwhile. It removes the scanner findings, and it covers users who expose their projects on purpose.

How This PR Solves The Issue

apk upgrade --no-cache runs before the existing apk add. The rebuilt image has Alpine 3.22.7, PHP 8.3.36 (CLI and php-fpm), and nginx 1.28.3, with no upgradable packages left. Alpine 3.22 gets security fixes until May 2027, so future image builds stay current even when upstream does not rebuild.

Alternatives considered:

  • Base on upstream xhgui/xhgui:0.24.x: it is a moving branch tag, not a release, and its PHP 8.3.32 is older than what Alpine 3.22 now provides.
  • Build xhgui from source: more maintenance than this problem needs.

We will also ask upstream perftools/xhgui for a 0.24.0 release and scheduled image rebuilds.

Manual Testing Instructions

ddev utility download-ddev --pr 9028
export PATH="$HOME/tmp/ddev-download-ddev/pr-9028:$PATH"
ddev config --project-type=php
ddev start
ddev xhgui on
ddev exec -s xhgui php -v
# Expect PHP 8.3.36 or later, not 8.3.23
ddev xhgui
# Expect the xhgui UI to load in the browser

Automated Testing Overview

TestDdevXhprofXhguiEnabled passes locally against the new image.

Release/Deployment Notes

The ddev/ddev-xhgui:f2afa48299 image must be pushed before CI can pull it.

🤖 Developed with assistance from Claude Code

@github-actions

Copy link
Copy Markdown

Pushed updated container image(s) for this PR:

  • ddev/ddev-xhgui:f2afa48299

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Download this PR's build for your OS and architecture with:

ddev utility download-ddev --pr 9028

Or download the artifact for your OS and architecture directly:

See Testing a PR.

Open in GitHub Codespaces

@stasadev stasadev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Claude Code built the PR on Docker and ran ddev xhgui on in a php project: PHP 8.3.36, profiles import and show up in the UI.

apk upgrade puts the upgraded files in a new layer on top of upstream's layers, so the image gets bigger (linux/amd64):

ddev/ddev-xhgui Download (compressed) Unpacked Our apk layer
2ee77bbcd8 (v1.25.5) ~16 MiB 75.5 MiB 7.5 MiB
f2afa48299 (this PR) ~27 MiB 119.1 MiB 40.0 MiB

I think that's fine for an optional service, and it goes away once perftools/xhgui#603 gets a rebuilt image.

🤖 Reviewed with assistance from Claude Code

…ecurity fixes

## Short Summary (TL;DR)

The `ddev-xhgui` image shipped PHP 8.3.23 from July 2025, because upstream `xhgui/xhgui:0.23` has not been rebuilt since then. The Dockerfile now runs `apk upgrade`, so each DDEV image build picks up current Alpine 3.22 security fixes.

## The Issue

Upstream built `xhgui/xhgui:0.23` on 2025-07-07 on Alpine 3.22.0. Our Dockerfile only ran `apk add`, so every DDEV release shipped that package set unchanged: PHP 8.3.23, nginx 1.28.0, OpenSSL 3.5.0, and 33 outdated packages in total. Security scanners flag the image. With `bind_all_interfaces` or `ddev share`, xhgui can also be reachable from the network.

## How This PR Solves The Issue

`apk upgrade --no-cache` runs before the existing `apk add`. The rebuilt image has Alpine 3.22.7, PHP 8.3.36 (CLI and php-fpm), and nginx 1.28.3, with no upgradable packages left. Alpine 3.22 gets security fixes until May 2027.

Alternatives considered:

- Base on upstream `xhgui/xhgui:0.24.x`: it is a moving branch tag, not a release, and its PHP 8.3.32 is older than what 3.22 now provides.
- Build xhgui from source: more maintenance than this problem needs.

We will also ask upstream perftools/xhgui for a 0.24.0 release and scheduled image rebuilds.

## Manual Testing Instructions

```bash
ddev utility download-ddev --pr 9028
export PATH="$HOME/tmp/ddev-download-ddev/pr-9028:$PATH"
ddev config --project-type=php
ddev start
ddev xhgui on
ddev exec -s xhgui php -v
# Expect PHP 8.3.36 or later, not 8.3.23
ddev xhgui
# Expect the xhgui UI to load in the browser
```

## Automated Testing Overview

`TestDdevXhprofXhguiEnabled` passes locally against the new image.

## Release/Deployment Notes

The `ddev/ddev-xhgui:f2afa48299` image must be pushed before CI can pull it.

🤖 Developed with assistance from [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@stasadev
stasadev force-pushed the 20261028_rfay_xhgui_apk_upgrade branch from 9041483 to dd9df14 Compare October 29, 2026 15:20
@github-actions

Copy link
Copy Markdown

Pushed updated container image(s) for this PR:

  • ddev/ddev-xhgui:070c6ecc03

@rfay
rfay merged commit d0d3edb into ddev:main Oct 30, 2026
54 of 56 checks passed
@rfay
rfay deleted the 20261028_rfay_xhgui_apk_upgrade branch October 30, 2026 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants