Repository navigation
Update to alpine3.24_emoncms12.1.9 for PHP security fixes (GHSA-w8hw-w9fx-j79w) - #50
Merged
alexandrecuer merged 4 commits intoOct 25, 2026
Conversation
PHP 8.4.27 fixes the critical RCEs GHSA-w8hw-w9fx-j79w and GHSA-6wmf-4rv5-p3rp. The build now refuses to continue if the installed PHP is older than the patched release for its branch. - alpine 3.19 -> 3.24, PHP 82 -> 84 (packages installed as phpXX-*) - s6-overlay 3.1.6.2 -> 3.2.3.2, services registered in user-bundles.d - phpredis pinned to 6.3.0 - phpize/php-config called by their versioned names, the unversioned ones are not provided, which left the image without redis.so and mosquitto.so - Mosquitto-PHP built with -Wno-error=int-conversion for gcc 14+ on musl - set -e on the build steps so failures stop the build - mariadb-upgrade at startup for existing databases (10.11 -> 11.8) - GitHub Actions bumped to current majors, workflow defaults 3.24 / 84 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
@TrystanLea : thanks, will read, because i can change alpine version without modifying the base code emoncms/.github/workflows/emoncms.yml Line 41 in 9b4c365 |
| git clone --depth 1 $MOSQUITTO_PHP;\ | ||
| cd Mosquitto-PHP;\ | ||
| phpize$PHP_VER;\ | ||
| # musl strerror_r returns int, not char *, and gcc 14+ makes that an error |
Contributor
There was a problem hiding this comment.
Good catch, so there is something to improve in the mosquitto php code
Contributor
There was a problem hiding this comment.
Probably something like that which works both for posix and gnu
PHP_MOSQUITTO_API char *php_mosquitto_strerror_wrapper(int err)
{
char *buf = ecalloc(256, sizeof(char));
#if defined(__GLIBC__) && defined(_GNU_SOURCE)
char *msg = strerror_r(err, buf, 256);
if (msg != buf) {
char *result = estrdup(msg);
efree(buf);
buf = result;
}
#else
if (strerror_r(err, buf, 256) != 0) {
efree(buf);
return NULL;
}
#endif
if (!buf[0]) {
efree(buf);
return NULL;
}
return buf;
}
Contributor
alexandrecuer
approved these changes
Oct 25, 2026
Updated version to alpine3.24_emoncms12.2.0 and included security update details.
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.





Hello @alexandrecuer , this is claude generated, I'm still reviewing this
Claude generated text:
Updates the add-on build so the image gets PHP 8.4.27. That release fixes GHSA-w8hw-w9fx-j79w and GHSA-6wmf-4rv5-p3rp. Both are critical, unauthenticated RCEs, and the first is confirmed against Apache mod_php, which is the setup this image uses. The image currently published (
alpine3.20_emoncms11.9.10) runs PHP 8.3.15.This is the same update as emoncms/emoncms-docker#59, adapted to the Alpine build.
Alpine packages
php848.4.27-r0 is now on the Alpinev3.24mirrors. A clean build installs it with no extra steps. The earlier version of this PR had a build step that failed on a vulnerable PHP while the mirrors still served 8.4.26. That step has been removed.Changes
develop(unpinned)PHPREDIS_VERSION)config.yamlandCHANGELOG.mdare bumped toalpine3.24_emoncms12.1.9, as in the previous release commit.Fixes the new versions needed
phppackage. Packages are now installed asphp$PHP_VER-*, and/usr/bin/phpis symlinked if missing.phpize84andphp-config84. With the oldcd phpredis && phpize && ...chain the build still succeeded, becauseshdoes not stop on failures inside an&&list. The result was an image withoutredis.soandmosquitto.so, where every worker crashed withClass "Redis" not found. The steps now call the versioned tools one per line, and the build checks that both extensions load.mosquitto.c:892, because GCC 14 and later treat implicit int-to-pointer conversion as an error. On musl,strerror_rreturnsint, notchar *. The return value is never used, so the build sets-Wno-error=int-conversion. The real fix belongs in openenergymonitor/Mosquitto-PHP.user/user2bundles moved to/etc/s6-overlay/user-bundles.d. With only the version bumped, thetouchcalls would fail silently and no service would start. The s6 and extensionRUNblocks now useset -ex, so problems like this fail the build.sql_ready.shrunsmariadb-upgradeon existing installs. It is in the newmariadb-server-utilspackage and does nothing once the tables are up to date.pip3 install --break-system-packages redis, needed for theUSE_REDISPY_APK=0path on Python 3.14. The default apk path is unchanged.Upgrade note for existing installs
On first start, the MariaDB datadir in
/data/emoncms/mysqlis upgraded from 10.11 to 11.8. This cannot be undone, so users should back up first. As in earlier releases, the emoncms database structure should be updated from the admin page after upgrading (emoncms 11.9 → 12.1).Testing (amd64)
docker build --pull --no-cachewithBRANCH=stable,EMONCMS_SRC=https://github.com/emoncms/emoncmsinstalls PHP 8.4.27 (php84-8.4.27-r0), MariaDB 11.8.9, Redis 8.8.0 and Mosquitto 2.1.2. phpredis and Mosquitto-PHP load.emoncms_mqtt,feedwriter,service-runnerandsync_uploadrunning asapache.emon/testnode/powerover MQTT appeared as an input.alexjunk/emoncms:alpine3.20_emoncms11.9.10(MariaDB 10.11.14) started on the new image.mariadb-upgradebrought it to 11.8.9, and the user and inputs were kept. On the next restart, the upgrade step reported nothing to do.After merge
Run emoncms docker images to docker hub - mention of emoncms version with the defaults, which are now 3.24 / 84. This publishes
alexjunk/emoncms:alpine3.24_emoncms12.1.9, the tagconfig.yamlnow points to. Run thelatestworkflow as well if you use it.🤖 Generated with Claude Code