-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 NEFARIOUSPLAN-CANONICAL-V1 {"body_md":"## `synoplugind` is a root daemon whose plugin scripts take their environment from a text file\n\nDSM ships a daemon named `synoplugind` that runs as root and listens on the Unix-domain socket `/run/synoplugind/server.sock`. Other DSM services, including the web login service `SYNO.API.Auth`, talk to it through the SDK in `libsynosdk.so.7`. When a plugin fires, the daemon:\n\n1. receives a set of `KEY=VALUE` arguments from the SDK,\n2. writes them to a per-invocation text file,\n3. parses that file back and calls `setenv()` for each pair,\n4. `exec`s the plugin scripts in `/usr/syno/plugin//` as root with that environment.\n\nThe plugin relevant to CVE-2024-10441 is `weblogin`. Its scripts receive, among others, `USER`, `TYPE`, and `IS_KNOWN_DEVICE`. `USER` is the attacker-controlled `account` string posted to the login endpoint.\n\nThe text file is line oriented. Single-line values are written flat:\n\n```\nTYPE=login\nIS_KNOWN_DEVICE=no\n```\n\nMulti-line values are wrapped between two sentinel strings:\n\n```\nUSER=PLUGIN_VALUE_START\nfirst line of value\nsecond line of value\nPLUGIN_VALUE_END\n```\n\nBoth sentinels are plain ASCII text on a line by themselves. There is no length prefix, no checksum, no quoting, and no escape sequence. The parser on the daemon side reads a line, and if the line equals `PLUGIN_VALUE_END`, the current value is closed.\n\n## The end of a value is a text string\n\nPatch-diffing the pre-fix `synoplugind`, `libsynosdk.so.7`, and `SYNO.API.Auth.so` against the November 2024 build yields one structural change and one validation string. The serializer in the pre-fix SDK writes the attacker's `account` value verbatim between the two sentinels. It does not scan the value for the closing sentinel. It does not call any encoding function. It calls, in effect:\n\n```c\nfprintf(fp, \"%s=PLUGIN_VALUE_START\\n%s\\nPLUGIN_VALUE_END\\n\", key, value);\n```\n\nIf `value` happens to contain a line whose exact contents are `PLUGIN_VALUE_END`, the parser on the daemon side closes the current value early, treats every subsequent line up to the real `PLUGIN_VALUE_END` as a new top-level `KEY=VALUE` pair, and `setenv`s each one into the environment of the root plugin script.\n\nThis is CWE-116, Improper Encoding or Escaping of Output, in its purest form. The author of the serializer chose a sentinel out of the attacker's alphabet and then did not bother to forbid it on the way in. There is no character to escape. `PLUGIN_VALUE_END` is seventeen ASCII letters and an underscore. Every one of them is legal in an HTTP POST body. The content-is-command pattern is literal here: the attacker's content, read back line by line, becomes a command to the parser to end a value and start parsing new keys.\n\n## The function name says Pre, and Pre means pre-auth\n\nThe entry point lives in `SYNO.API.Auth.so`. Demangled, its C++ symbol is:\n\n```\nSYNO::SDKPluginWebloginPre(const std::string& account,\n const std::string& device,\n bool)\n```\n\nThe mangled form, for anyone reaching in with `dlsym`, is `_ZN4SYNO20SDKPluginWebloginPreERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_b`.\n\nThe `Pre` suffix is not stylistic. `WebloginPre` fires on the pre-authentication branch of the login state machine, before the password is checked, as the plugin framework's first-opportunity hook for other services to observe or shape the login. It takes the raw `account` field from the request, hands it to `SLIBPluginSetArg(ctx, \"USER\", account, 0, 0)` with no filtering, and asks the SDK to fire `SLIBPluginAction(PRE, ctx)`. The SDK then writes the file above and signals the daemon. The daemon, running as root, reads the file and `setenv`s. No credential check has occurred yet.\n\nThat is why CVE-2024-10441 is CVSS 9.8, AV:N, AC:L, PR:N, UI:N. Nothing in the chain between an unauthenticated HTTP request and `execve` of a root shell script with an attacker-controlled environment ever looks at the password.\n\n## The injection is four lines\n\nThe payload that turns this parsing error into a root shell has to do two things: close the `USER` block early so that a chosen key is parsed as a top-level pair, then reopen a benign block so that the trailing `PLUGIN_VALUE_END` the serializer always writes still has a value to belong to.\n\nThe four line structure, placed in `account`:\n\n```\nx\nPLUGIN_VALUE_END\nLD_PRELOAD=/evil.so\nZZ=PLUGIN_VALUE_START\nz\n```\n\nWhen `synoplugind` serializes and reparses this, the environment handed to `/bin/sh /usr/syno/plugin/weblogin/*.sh --pre` is:\n\n```\nUSER=x\nLD_PRELOAD=/evil.so\nZZ=z\nTYPE=login\nIS_KNOWN_DEVICE=no\n```\n\nLine two closes `USER` early. Line three is parsed as a brand new top-level environment variable. Line four opens a new block `ZZ` so that the closing `PLUGIN_VALUE_END` the serializer will append at the end of the file is consumed legally. Without line four, the trailing sentinel is orphaned, the daemon rejects the batch with a `Bad env key value` log line, and no `setenv` happens. The `ZZ` reopener is not optional; it is the frame around the attacker's own frame break.\n\nOver HTTP the delivery is a GET against the login endpoint with newlines URL-encoded as `%0A`:\n\n```\nGET /webapi/entry.cgi?api=SYNO.API.Auth&version=7&method=login&session=webui&format=sid&passwd=x&account=x%0APLUGIN_VALUE_END%0ALD_PRELOAD=%2Fevil.so%0AZZ=PLUGIN_VALUE_START%0Az HTTP/1.1\nHost: nas.example:5001\n```\n\nThe `%0A` is mandatory. A raw newline in the request line malforms the HTTP, which is where the misleading HTTP 400 responses in some public write-ups come from; the server rejects the request before `SYNO.API.Auth` ever sees it. URL-decoded, the server stores `account` as a five-line string and feeds it to `SDKPluginWebloginPre`.\n\nDropping `/evil.so` on the box in the first place is out of scope for this chain; Pwn2Own entries typically pair this primitive with a separate arbitrary-write or authenticated-upload primitive to stage the shared object. Once the object is on disk at a path readable by root, the loader's constructor runs as root at the first `exec` the plugin triggers, and the Pumpkin Chang / Orange Tsai PoC's constructor demonstrates `uid=0(root) gid=0(root)`.\n\n## The constructor has to disarm itself\n\nA shared object loaded by `LD_PRELOAD` into a shell is inherited by every `fork`/`exec` the shell performs. A plugin shell script that calls `system` or `popen` will fork a new `/bin/sh`, which will re-load the same shared object, whose constructor will fork again, and so on. The reference PoC's constructor does three things in order before running any payload:\n\n1. `unsetenv(\"LD_PRELOAD\")` as its first statement,\n2. `open(\"/tmp/.pwn_once\", O_CREAT|O_EXCL|O_WRONLY, 0600)` as a one-shot guard; if the open fails with `EEXIST` the constructor returns silently,\n3. only then does it run its demonstration (`write` to `/out.txt`, `execl(\"/usr/bin/id\", ...)`, etc.).\n\nThis is a detail that matters in post-hoc forensics: an attacker who got the guard wrong leaves a fork-bomb signature in `dmesg` and in whatever process accounting is enabled, while an attacker who got it right leaves one `/tmp/.pwn_once` file and whatever their constructor explicitly logged.\n\n## The fix is Base64, not an escape function\n\nThe patched SDK in the November 5, 2024 build no longer writes the attacker's string between text sentinels at all. It calls `SLIBCBase64Encode` on the value before serialization, and the daemon side calls `SLIBCBase64Decode` after parsing. The sentinel strings are still there in the format, but the bytes between them are now constrained to the Base64 alphabet, which does not contain the `_` character that `PLUGIN_VALUE_END` needs. The daemon additionally rejects values that do not decode cleanly, logging `Bad env key value`, which is the string that shows up new in the binary diff.\n\nThis is the structural reason the vendor did not ship an escape function. There is no sequence of printable ASCII characters that is both reserved by the plugin environment file format and illegal in a login `account` field, so there is no character for a pre-serialization filter to strip. The only moves are to change the alphabet of the value (Base64, hex, length-prefixed binary) or to pick a sentinel that cannot appear in the input alphabet (a NUL byte, for example, which Synology did not choose). The patch chose Base64. The format was the bug, and the fix replaced the format.\n\nThe author of the pre-fix serializer was making the closed-network-assumed trade: `synoplugind` listens on a Unix-domain socket that only root-group processes can open, so the author treated the SDK's input as already trusted. Every byte that reaches the socket arrives from inside DSM. What the author did not account for is that `SYNO.API.Auth`, running on the far side of an unauthenticated HTTP endpoint, is also inside DSM, and the string the attacker types on the login page is the same string the SDK serializes. The IPC boundary was trusted; the HTTP boundary above it was not held to the same standard.\n\n## What the advisory names and what NVD does not\n\nSynology's SA-24:20 names the researchers (Pumpkin Chang and Orange Tsai of DEVCORE; Ryan Emmons; Team Smoking Barrels), cites ZDI-CAN-25403, and lists the fixed versions:\n\n| Branch | Fixed in |\n|---|---|\n| DSM 7.2.2 | 7.2.2-72806-1 |\n| DSM 7.2.1 | 7.2.1-69057-6 |\n| DSM 7.2 | 7.2-64570-4 |\n| DSM 7.1.1 | 7.1.1-42962-7 |\n| DSM 6.2.4 | 6.2.4-25556-8 |\n| BeeStation OS | 1.1-65374 |\n| DSMUC | 3.1.4-23079 |\n\nCISA's KEV entry, added November 18, 2026, lists the CVE as \"Synology DiskStation Manager (DSM) Improper Encoding or Escaping of Output Vulnerability,\" ties the remediation deadline to today, November 21, 2026, and marks the \"Known Ransomware Use\" column as `Unknown`. The NVD record, published March 19, 2025 and unmodified since, still describes the vectors as \"unspecified.\"\n\nThe three-day KEV window is the shortest CISA ever issues and the catalog's way of saying that the vulnerability's technical details, its PoC, and its fix are all more than a year old at the point of KEV listing. The agency's model is not that the vulnerability is novel. The agency's model is that the agencies running DSM on federal networks have had since November 2024 to patch and have not.\n\nTwo years and twenty-four days is how long a pre-auth, CVSS 9.8, Pwn2Own-demonstrated bug with a documented four-line injection payload sits on the NVD as \"unspecified vectors\" before the catalog of last resort catches it. The vectors have been specified in this post, from the symbol name down to the Base64 alphabet, because `PLUGIN_VALUE_END` is not an unspecified vector. It is eighteen ASCII characters.","closing_line":"The fix did not escape `PLUGIN_VALUE_END`. The fix replaced the text format that let `PLUGIN_VALUE_END` appear as data in the first place, and twenty-four months after Pwn2Own the CVE record NVD serves still calls the vectors unspecified.","hook_md":"The NVD description of CVE-2024-10441 reads, in full: \"allows remote attackers to execute arbitrary code via unspecified vectors.\" The vectors were demonstrated on the Pwn2Own Ireland 2024 stage by DEVCORE's Pumpkin Chang and Orange Tsai in late October 2024, patched by Synology in advisory SA-24:20 on November 5 of that year, assigned CVE-2024-10441, and then published to the NVD on March 19, 2025 with the sentence above. CISA added it to the Known Exploited Vulnerabilities catalog on November 18, 2026, two years and twenty-four days after the Pwn2Own demonstration. The federal remediation deadline is today. The vectors are two literal ASCII strings: `PLUGIN_VALUE_START` and `PLUGIN_VALUE_END`. The pre-auth `account` field that `SYNO::SDKPluginWebloginPre` hands to `synoplugind` before the password is ever checked is written between them.","post_id":880,"slug":"synology-cve-2024-10441-plugin-value-end-is-a-value","title":"CVE-2024-10441: Synology's synoplugind Ended Multi-line Values With A Text String, And The Pre-Auth Account Field Was A Multi-line Value","type":"initial","unreadable_sentence":"The patch did not add an escape function, because there is no character sequence to escape that an attacker cannot also type; the patch replaced the format, because the format was the bug."} -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQRf0htP5+SjynlxywneZjl4jgkQJgUCawHGoQAKCRDeZjl4jgkQ JuAAAP4hOANCCnKeMUrSZ2bvPudQXtfng8pC7g2FCwtxRrRXLAEAvYysi8y1DMT9 Bt7fIlmhXIZ+58AapjjFoqV/oDvwaws= =pkwg -----END PGP SIGNATURE-----