OpenEMR php2shell Advisory (Remote Code Execution Exploit)

OpenEMR php2shell Advisory

Oct 21, 2026 ·

A critical, actively-exploited PHP vulnerability (php2shell — CVE-2026-109618 / CVE-2026-109619) allows unauthenticated remote code execution. OpenEMR 8.4.x Docker deployments can be fixed now with an in-container package update; 8.3.x / 8.2.x and 8.0.x have no in-container fix yet and need the steps below.

The vulnerability

php2shell (CVE-2026-109618 and CVE-2026-109619) is a pair of critical flaws in PHP core, rated CVSS v4.0 9.2, both leading to unauthenticated remote code execution. They were disclosed on 2026-10-21 and are being actively exploited, with public proof-of-concept code.

  • CVE-2026-109618 — out-of-memory handling during multipart (rfc1867) request parsing can leave request data partially initialized, and cleanup then treats it as valid.
  • CVE-2026-109619 — request-owned internal state can survive after its memory is freed and be reused by a later request on the same worker (confirmed via the session upload-progress feature).

Any site with sessions or file uploads enabled — both on by default — is exploitable. The fix is PHP 8.5.12 / 8.4.27 / 8.3.36 / 8.2.35; PHP states there is no complete mitigation short of updating.

More details can be found on the PHP’s security advisory here: https://www.php.net/archive/2026.php#2026-10-21-5

Affected images and fix status

Whether an in-container fix exists depends on the Alpine base each image ships, which we confirmed by inspecting the published images.

OpenEMR image PHP Alpine base In-container apk fix today
8.4.x (latest) 8.5 3.24 Yes — php85 8.5.12 is published for Alpine 3.24
8.3.x 8.5 3.23 Not yet — awaiting the Alpine 3.23 backport
8.2.x 8.5 3.23 Not yet — awaiting the Alpine 3.23 backport
8.0.x 8.4 3.22 No — Alpine 3.22 community is end-of-life; no backport planned

Alpine supports community-repository packages (which include PHP) only until the next stable release, so only the current stable (3.24) is guaranteed the fix.

OpenEMR 8.4.x — fix available now

These images run PHP 8.5 on Alpine 3.24, and Alpine has published the fixed packages (8.5.12). Apply the fix to a running deployment immediately — no OpenEMR version change and effectively no downtime:

docker compose exec openemr sh -lc '/sbin/apk update && /sbin/apk upgrade $(/sbin/apk info -q | grep "^php85")'
docker compose restart openemr

Verify with docker compose exec openemr php -v (expect 8.5.12 or higher).

Pulling the latest image does not apply the fix on its own. The currently published 8.4.x image was built before the fix was available, so pulling or updating to it still ships unpatched PHP — you must run the commands above regardless, until a rebuilt image is published. This in-container update lives in the container’s writable layer: use restart, not down / up --force-recreate, which would revert it.

OpenEMR 8.3.x / 8.2.x — awaiting the Alpine 3.23 backport

These images run PHP 8.5 on Alpine 3.23. Alpine released the 8.5.12 fix for its current stable (3.24) but not yet for 3.23, so there is no in-container update for these images today. Alpine maintainers are preparing the 3.23 backport; once it lands, apply the fix exactly as 8.4.x users do:

docker compose exec openemr sh -lc '/sbin/apk update && /sbin/apk upgrade $(/sbin/apk info -q | grep "^php85")'
docker compose restart openemr

Options, in order of ease:

  1. Wait for the 3.23 backport — we are monitoring it and will refresh our images as soon as it lands.
  2. Move to an OpenEMR 8.4.x image (Alpine 3.24, already fixed) and run the commands above; the same “pulling the image alone is not enough” caveat applies.
  3. As a last resort, build PHP 8.5.12 for Alpine and apply it yourself.

OpenEMR 8.0.x — Alpine 3.22 base is end-of-life

These images run PHP 8.4 on Alpine 3.22, whose community repository is end-of-life — Alpine has no plans to backport the fix. You will need to move to a supported image (8.4.x on Alpine 3.24) or build PHP 8.4.27 for Alpine yourself.

If you cannot deploy a fix

Until a fix is in place, reduce exposure:

  • Disconnect OpenEMR from any public-facing internet — it holds PHI and should not be directly reachable.
  • Evaluate your exposure to internal users and restrict access to trusted networks or VPN.
  • If necessary, take OpenEMR offline until a fix is available.

These are containment measures, not a fix; PHP states there is no complete mitigation short of updating.

Build and release status

Our Docker image build infrastructure is temporarily offline due to an upstream Ubuntu/Launchpad PPA outage affecting our build pipeline, so we cannot publish rebuilt images right now. The in-container apk update for 8.4.x does not depend on our build pipeline and is available now. We will notify users when our build infrastructure is restored and refreshed images are published. The 8.3.x / 8.2.x rebuilds additionally depend on the pending Alpine 3.23 backport.

What we are tracking

We are monitoring the following and will update this advisory as each changes:

  • Alpine 3.23 php85 — moves past 8.5.6 when the 8.3.x / 8.2.x backport lands.
  • Alpine 3.24 php85 — a move past 8.5.12 would indicate a follow-up PHP release (8.5.13) with additional hardening, which has been discussed upstream.
  • Build pipeline — recovery of the Ubuntu/Launchpad PPA host, after which we rebuild and republish images.

OpenEMR php2shell Advisory

Follow-up update — October 22, 2026

Posted ~08:00 MST. All upstream Alpine PHP fixes have now landed, so patching in place works on every supported OpenEMR line. Corrected Docker images are rebuilding (see below).

Alpine fixes — all branches now patched

Alpine branch Used by Package Fixed version
3.24 OpenEMR 8.4.x php85 8.5.12-r0
3.23 OpenEMR 8.3.x, 8.2.x php85 8.5.12-r0
3.22 OpenEMR 8.0.x php82 / php83 / php84 8.2.35-r0 / 8.3.36-r0 / 8.4.27-r0

The fix is now in the Alpine repositories for every branch, so the in-container apk upgrade works on all supported versions. Compiling PHP from source is no longer necessary, and that earlier guidance is withdrawn.

Patch in place now — all versions

Works on 8.4.x, 8.3.x, 8.2.x, and 8.0.x:

docker compose exec --user root openemr sh -lc '/sbin/apk update && /sbin/apk upgrade $(/sbin/apk info -q | grep -E "^php8")'
docker compose restart openemr

After the restart, docker compose exec openemr php -v should report PHP 8.5.12 (8.4.x / 8.3.x / 8.2.x) or PHP 8.4.27 (8.0.x). Use restart, not down / up --force-recreate, or the upgrade in the container’s writable layer is discarded.

Current published Docker images

Our daily build ran ~07:00 UTC (01:00 MST), before the 3.23 and 3.22 fixes had published, so three of the four image lines are still pre-fix:

Image PHP as published Status
openemr/openemr:8.4.1 / :latest 8.5.12 Fixed
openemr/openemr:8.3.0 8.5.6 Vulnerable — rebuild in progress
openemr/openemr:8.2.0 8.5.6 Vulnerable — rebuild in progress
openemr/openemr:8.0.0.3 8.4.16 Vulnerable — rebuild in progress

If you pulled an 8.3.0, 8.2.0, or 8.0.0.3 image today, it does not yet contain the fix — apply the in-container apk upgrade above until corrected images publish.

Rebuild status

We have re-triggered the image builds now that the Alpine fixes are available. Corrected images are expected later this morning, but roughly 40 pull requests are ahead in our GitHub Actions queue, so it may take an hour or two — and is contingent on the builds completing (we hit build-infrastructure issues yesterday). We will post again once the rebuilt images are live and verified with php -v.

Second follow-up update — October 22, 2026

Posted ~09:30 MST (15:30 UTC), amended ~10:00 MST (16:00 UTC) when the 8.0.0.3 rebuild finished. Corrected images are now live and verified for all four lines.

Rebuilt 8.3.0, 8.2.0 and 8.0.0.3 images are live (8.4.1 re-published)

The re-triggered builds for 8.3.0 and 8.2.0 finished and were pushed to Docker Hub at 14:35 UTC (08:35 MST). We pulled both and confirmed inside the container: php -v reports PHP 8.5.12 (php85-8.5.12) on Alpine 3.23.7. The same image is also published under the dated tags 8.3.0-2026-10-22 and 8.2.0-2026-10-22.

Tag Published Digest
openemr/openemr:8.3.0 (= 8.3.0-2026-10-22) 2026-10-22 14:35 UTC sha256:c974729a9e63cf2b2964cc6a010d7f6a9b751c0bd236ddc9fd30582d4ddd0c27
openemr/openemr:8.2.0 (= 8.2.0-2026-10-22) 2026-10-22 14:35 UTC sha256:229f70bd0622432d0b214d9b75eba228e712d496ad4d80acdcc8ce7dbdcf96d5
openemr/openemr:8.4.1 / :latest (= 8.4.1-2026-10-22) 2026-10-22 15:32 UTC sha256:85349455340a8c9e5827c86894eb8f17bb928251df2853fafcf6ac98d57fe815
openemr/openemr:8.0.0.3 / :8.0.0 (= 8.0.0.3-2026-10-22, 8.0.0-2026-10-22) 2026-10-22 15:53 UTC sha256:6d029ebfa35036140620ce933dbd05070044317260f1b558a0df63d78dcc7b06

If you pulled 8.3.0 or 8.2.0 before 14:35 UTC today, you have the pre-fix image (PHP 8.5.6): pull again.

The 8.4.1 / latest image was also re-published at 15:32 UTC as part of the same rebuild round. Both the 07:27 UTC and 15:32 UTC builds carry PHP 8.5.12 (we verified the 15:32 UTC image: php85-8.5.12 on Alpine 3.24.3), so 8.4.1 users who pulled earlier today are already fixed and do not need to pull again.

8.0.0.3 — rebuilt image published 15:53 UTC

The 8.0.0.3 rebuild (https://github.com/openemr/openemr/actions/runs/39794860814) completed at 15:54 UTC (09:54 MST) and pushed 8.0.0.3, 8.0.0, 8.0.0.3-2026-10-22 and 8.0.0-2026-10-22. We pulled it and confirmed inside the container: php -v reports PHP 8.4.27 (php84-8.4.27) on Alpine 3.22.7.

Why this one lagged: Alpine’s 3.22 fixes (php84 8.4.27, php83 8.3.36, php82 8.2.35) only published between 12:27 and 13:35 UTC today, after our 08:12 UTC 8.0.0.3 build. If you pulled 8.0.0.3 or 8.0.0 before 15:53 UTC today (digest sha256:f98803ca80b3… or earlier), you have the pre-fix image with PHP 8.4.16: pull again.

Current published Docker images

Image PHP as published Status
openemr/openemr:8.4.1 / :latest 8.5.12 Fixed (07:27 UTC build; re-published 15:32 UTC, see above)
openemr/openemr:8.3.0 8.5.12 Fixed (rebuilt image published 14:35 UTC)
openemr/openemr:8.2.0 8.5.12 Fixed (rebuilt image published 14:35 UTC)
openemr/openemr:8.0.0.3 / :8.0.0 8.4.27 Fixed (rebuilt image published 15:53 UTC)

Moving to a fixed image

If you already applied the in-container apk upgrade, you are protected and nothing further is required; the patch persists across restart. When you are ready to be on a fixed image permanently (all four lines are now published):

docker compose pull openemr
docker compose up -d openemr
docker compose exec openemr php -v

Expect PHP 8.5.12 (8.4.x / 8.3.x / 8.2.x) or 8.4.27 (8.0.x). Recreating the container is what applies the new image, so this one time up -d is correct — the in-container patch it discards is already built into the new image. The recreate logs users out for the minute it takes; named and anonymous volumes (database, documents, certificates) are kept. Still do not use down -v.

To confirm which build you are running without entering the container:

docker inspect --format '{{index .RepoDigests 0}}' $(docker compose images -q openemr)

and compare the digest to the table above.

What we are tracking now

  • Nothing blocking — every supported OpenEMR image line now ships fixed PHP.
  • Alpine php85 on 3.23 / 3.24 and php84 on 3.22 — a move past 8.5.12 / 8.4.27 would indicate a follow-up PHP release with additional hardening; we would rebuild again.