-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 NEFARIOUSPLAN-CANONICAL-V1 {"body_md":"## The three lines, in order\n\nThe vulnerable function lives in `vendor/team-updraft/common-libs/src/updraft-rpc/class-udrpc2.php`, in the class `UpdraftPlus_Remote_Communications_V2`. The PoC README points at `includes/class-remote-communications-v2.php`, which has never existed at that path; the class name was copied, the directory was guessed. The code is in the vendor tree:\n\n```php\n// vendor/team-updraft/common-libs/src/updraft-rpc/class-udrpc2.php, line 460\npublic function decrypt_message($message) {\n\n if (!$this->key_local) throw new Exception('No decryption key has been set');\n\n $rsa = new phpseclib_Crypt_RSA();\n if (defined('UDRPC_PHPSECLIB_ENCRYPTION_MODE')) $rsa->setEncryptionMode(UDRPC_PHPSECLIB_ENCRYPTION_MODE);\n // Defaults to CRYPT_AES_MODE_CBC\n $rij = new phpseclib_Crypt_Rijndael();\n\n // Extract the Symmetric Key\n $len = substr($message, 0, 3);\n $len = hexdec($len);\n $sym_key = substr($message, 3, $len);\n\n // Extract the encrypted message\n $cipherlen = substr($message, ($len + 3), 16);\n $cipherlen = hexdec($cipherlen);\n\n $ciphertext = substr($message, ($len + 19), $cipherlen);\n $ciphertext = base64_decode($ciphertext);\n\n // Decrypt the encrypted symmetric key\n $rsa->loadKey($this->key_local);\n $sym_key = base64_decode($sym_key);\n $sym_key = $rsa->decrypt($sym_key);\n\n // Decrypt the message\n $rij->setKey($sym_key);\n\n return $rij->decrypt($ciphertext);\n\n}\n```\n\nTwo of the lines parse fields out of the caller's blob. One runs RSA decryption and reassigns `$sym_key` to its result. One installs that result as the AES key. Nothing between the third and the fourth line inspects what the third line produced. The comment above the install reads `// Decrypt the message`. It does not read `if the symmetric key is valid`.\n\nThe PHP comments around the bug describe the message format the function is unpacking. They do not describe the failure mode of the function whose return value the next line consumes.\n\n## phpseclib's setKey does not throw\n\nphpseclib's RSA `decrypt()` returns the decrypted plaintext on success and the boolean `false` on failure. The failure cases are well-documented: malformed PKCS#1 padding, ciphertext block too short, ciphertext block too long, decrypted bytes that do not match the expected padding marker. An attacker who does not hold the private key cannot produce ciphertext that decrypts cleanly. They can trivially produce ciphertext that fails.\n\nphpseclib's symmetric `setKey()` is inherited from `phpseclib\\Crypt\\Base`:\n\n```php\n// vendor/phpseclib/phpseclib/phpseclib/Crypt/Base.php, line 620\nfunction setKey($key)\n{\n if (!$this->explicit_key_length) {\n $this->setKeyLength(strlen($key) << 3);\n $this->explicit_key_length = false;\n }\n\n $this->key = $key;\n $this->changed = true;\n $this->_setEngine();\n}\n```\n\n`strlen(false)` is zero. `Rijndael::setKeyLength(0)` matches the `<= 128` branch and sets the key length to 16 bytes. The stored `$this->key` is the literal boolean `false`. Neither method validates the type of `$key`. Neither method throws. The object's state is now: key length 128 bits, key material `false`.\n\nWhat happens at the next encryption-block expansion (`Rijndael::_setupKey`, then `unpack('N*words', $this->key)` against a value PHP coerces to the empty string) is deterministic and computable by anyone with a copy of phpseclib. The PoC author tested it and reports that AES-128-CBC with the 16-byte all-NULL key and the all-NULL IV produces ciphertext the server accepts as a valid `udrpc_message` envelope. The 1.26.5 patch's third clause (`strlen($sym_key) < 16`) confirms the vendor reached the same conclusion: short keys, regardless of value, were the bypass, because phpseclib's behavior on short or empty key material is computable by both ends without needing the RSA private key.\n\nThe RSA decrypt's failure flag and the Rijndael setKey's degenerate input are the same byte. The line between them did not check which one it was.\n\n## Format 1 was not an accident. The file's own comment said so.\n\nThe listener that invokes `decrypt_message` is `UpdraftPlus_Remote_Communications_V2::wp_loaded`. WordPress fires `wp_loaded` once per request, on every page load, including unauthenticated ones, the moment plugin loading finishes. The listener registers itself there.\n\nWhen the listener runs, it reads `$_POST['format']`. The accepted values are 1 and 2. Format 2 is the modern protocol with separate sender and receiver keypairs and signed messages. Format 1 is older and has neither. The same file's own comment, above the format dispatch:\n\n```php\n/*\nIn format 1 (legacy/obsolete), the one encrypts (the shared AES key) using one half\nof the key-pair, and decrypts with the other; whereas the other side of the conversation\ndoes the reverse when replying (and uses a different shared AES key). Though this is\npossible in RSA, this is the wrong thing to do - see\nhttps://crypto.stackexchange.com/questions/2123/...\nIn format 2, both sides have their own private and public key. The sender encrypts using\nthe other side's public key, and decrypts using its own private key. Messages are signed\n(the message digest is SHA-256).\n*/\n```\n\nThe author wrote the words \"this is the wrong thing to do\" and cited a Stack Exchange post explaining why. Twenty lines down, in the same function:\n\n```php\nif ($format >= 2) {\n if (empty($_POST['signature'])) {\n $this->log('No message signature found', 'error');\n die;\n }\n if (!$this->key_remote) {\n $this->log('No signature verification key has been set', 'error');\n die;\n }\n if (!$this->verify_signature($udrpc_message, $_POST['signature'], $this->key_remote)) {\n $this->log('Signature verification failed; discarding', 'error');\n die;\n }\n}\n```\n\nSignature verification is conditional on `$format >= 2`. When the caller posts `format=1`, the entire block does not run. The next code path is `decrypt_message($udrpc_message)`. The author also added a dedicated format-1-aware error branch immediately above this block, with a log message containing the literal string `'no local key (format 1): cannot decrypt'`. They knew the format-1 branch existed. They knew it was unsigned. They kept it accepting messages.\n\n## What the attacker sends, what the server runs\n\nPreconditions: the WordPress site has UpdraftPlus installed and is connected to UpdraftCentral. UpdraftPlus reports more than three million active installs; the subset connected to UpdraftCentral is the affected population. The listener's `key_name` is the value the message envelope must address; it is the lowercased hex of an MD5 derived during the site's UpdraftCentral handshake and stored as a site option. Recovery channels include UpdraftCentral handshake artifacts, the WordPress error log under certain debug levels, and the predictable namespace the indicator is drawn from.\n\nThe attacker constructs the envelope `encrypt_message` would have produced:\n\n```\n[3 hex chars sym_key length][base64(garbage sym_key bytes)][16 hex chars cipher length][base64(AES-128-CBC ciphertext)]\n```\n\nThe \"garbage sym_key bytes\" are anything that will not decrypt as valid PKCS#1 against the server's RSA private key. The PoC uses 128 bytes of `\\x41`. The AES-128-CBC ciphertext is the attacker's JSON payload, encrypted with the 16-byte value phpseclib produces from `setKey(false)` and the all-NULL IV. Both ends compute that key identically without consulting the RSA private key.\n\nThe JSON payload names the RPC command, the parameters, and the WordPress `user_id` the dispatcher will run as. UpdraftCentral commands accept `plugin.upload_plugin` (write an attacker-supplied ZIP into `wp-content/plugins/`) and `plugin.activate_plugin` (activate it). The dispatcher wraps each command in `wp_set_current_user($user_id)`; the attacker chooses the user.\n\nThe final request:\n\n```http\nPOST / HTTP/1.1\nHost: target\nContent-Type: application/x-www-form-urlencoded\n\nformat=1&key_name=&udrpc_message=\n```\n\nThe PoC ships the envelope construction, the AES helper, the RPC builder, and a single recon call to `plugin.get_plugins`. It does not call `plugin.upload_plugin` or `plugin.activate_plugin` in `main`; those functions exist, commented out, with a stub ZIP literal of `b\"PK\\x03\\x04...\"`. The PoC's POST body is `{\"udrpc_message\": message}` only, omitting the `format` and `key_name` fields the listener requires; those are the two lines an operator adds to convert recon to weaponization. The script's code comments are in Turkish (\"Eğitim Amaçlı PoC\", \"Yalnızca kendi localhost ortamınızda kullanın\"); the README is English, polished, and describes a multi-file directory layout (`payloads/`, `shell/`, `docs/`, a `test-shell.php` webshell, a `build_shell.py` packager) that does not exist on disk.\n\n## The patch adds three lines. The same commit also removes format 1 from almost everything.\n\nThe 1.26.5 patch to `decrypt_message`:\n\n```diff\n $sym_key = base64_decode($sym_key);\n $sym_key = $rsa->decrypt($sym_key);\n\n+ if (false === $sym_key || !is_string($sym_key) || strlen($sym_key) < 16) {\n+ return false;\n+ }\n+\n // Decrypt the message\n $rij->setKey($sym_key);\n```\n\nThree lines. The CVE record names them.\n\nThe same commit makes four other changes to the same file. The material one:\n\n```diff\n+ // Restrict use of format 1\n+ if ($format < 2 && (!in_array($command, array('ping', 'get_file_status', 'send_chunk', 'upload_complete')) || !preg_match('/^([a-f0-9]+)\\.migrator.updraftplus.com$/', $this->key_name_indicator))) {\n+ $this->log(\"Obsolete format used - dropping (command: $command)\", 'error');\n+ die;\n+ }\n```\n\nFormat 1 is no longer accepted on general listeners. It is accepted only when the key indicator matches the migrator namespace and the command is one of four. The signing discipline is also tightened: `create_message` no longer makes signature generation conditional on `format >= 2`, so outgoing messages are always signed; the response decoder requires signatures whenever either side speaks anything past format 1. The header comment changes its description of format 1 from \"legacy/obsolete\" to \"has been removed.\"\n\nThe CVE names the null-check. The patch closes the null-check, the format-1 surface that delivered messages to the null-check, and the always-sign discipline that would have caught the message before `decrypt_message` was reached. The CVE is the symptom. The patch is the architectural retreat from a format the same author had documented as wrong in a comment block downstream consumers could read.\n\n## Fail open intercept, without the catch block\n\nThis pattern has a name on this blog: [fail-open-intercept](/patterns/fail-open-intercept). The catalog already holds the Tomcat [`EncryptInterceptor`](/posts/tomcat-encryptinterceptor-fails-open) exhibit, where an AES-cluster gate caught `GeneralSecurityException` from its decrypt call, logged the failure, and called `super.messageReceived(msg)` outside the try. The pattern's mechanism is a security gate that catches the security failure and continues.\n\nUpdraftPlus is the variant without the try/catch. phpseclib's `decrypt()` does not throw. PHP's loose typing accepts `false` everywhere a string is accepted. phpseclib's `setKey()` does not validate its argument. The gate fails open through silent coercion across two library boundaries. No `catch`. No `log.warn`. No stack trace anywhere in the failure path. The pattern's playbook entry reads \"distinguish transport failure from authentication failure in gate logic.\" UpdraftPlus distinguished them in a comment block above the dispatch. The code did not.\n\nThe Tomcat exhibit's unreadable sentence: \"Every administrator who configured cluster encryption is affected. Every administrator who left it unconfigured is not.\" The UpdraftPlus dialect inverts the precondition. Every administrator who connected to UpdraftCentral is affected, because the listener only attaches when UpdraftCentral is connected. The encryption was the feature. The encryption was the surface.\n\nPoC: [izxci/CVE-2026-10795](https://github.com/izxci/CVE-2026-10795)","closing_line":"phpseclib's decrypt returns false. phpseclib's setKey accepts false. UpdraftPlus put a line between them.","hook_md":"UpdraftPlus's `decrypt_message` function in `class-udrpc2.php` does three things in order. It calls `$rsa->decrypt($sym_key)`, then `$rij->setKey($sym_key)`, then `$rij->decrypt($ciphertext)`. The first line's documented failure mode is `return false`; the second line's documented behavior, when handed `false`, is to coerce it to the empty string and install it as a 16-byte AES key. CVE-2026-10795 is the line missing between the first two: any check that what the gate was about to install as a key was, in fact, a key.","post_id":603,"slug":"updraftplus-cve-2026-10795-false-was-the-key","title":"CVE-2026-10795: UpdraftPlus's RSA Decrypt Returned False. The Next Line Used It As The Key.","type":"initial","unreadable_sentence":"The RSA decrypt's failure flag and the Rijndael setKey's degenerate input are the same byte. The line between them did not check which one it was."} -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQRf0htP5+SjynlxywneZjl4jgkQJgUCasqkCwAKCRDeZjl4jgkQ JlWLAP98FaWYzsdqrCzSPUNyDctpGvGjrzLKFuXZUM+tJMXofgEAnhX7mZAOBjQa sBErAHvxcgIQoIJW0r0ldEhdNRJ0dgI= =XhZQ -----END PGP SIGNATURE-----