//nefariousplan

CVE-2026-10795: UpdraftPlus's RSA Decrypt Returned False. The Next Line Used It As The Key.

vendor

pattern

cve

proof of concept

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.

The three lines, in order

The 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:

// vendor/team-updraft/common-libs/src/updraft-rpc/class-udrpc2.php, line 460
public function decrypt_message($message) {

    if (!$this->key_local) throw new Exception('No decryption key has been set');

    $rsa = new phpseclib_Crypt_RSA();
    if (defined('UDRPC_PHPSECLIB_ENCRYPTION_MODE')) $rsa->setEncryptionMode(UDRPC_PHPSECLIB_ENCRYPTION_MODE);
    // Defaults to CRYPT_AES_MODE_CBC
    $rij = new phpseclib_Crypt_Rijndael();

    // Extract the Symmetric Key
    $len = substr($message, 0, 3);
    $len = hexdec($len);
    $sym_key = substr($message, 3, $len);

    // Extract the encrypted message
    $cipherlen = substr($message, ($len + 3), 16);
    $cipherlen = hexdec($cipherlen);

    $ciphertext = substr($message, ($len + 19), $cipherlen);
    $ciphertext = base64_decode($ciphertext);

    // Decrypt the encrypted symmetric key
    $rsa->loadKey($this->key_local);
    $sym_key = base64_decode($sym_key);
    $sym_key = $rsa->decrypt($sym_key);

    // Decrypt the message
    $rij->setKey($sym_key);

    return $rij->decrypt($ciphertext);

}

Two 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.

The 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.

phpseclib's setKey does not throw

phpseclib'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.

phpseclib's symmetric setKey() is inherited from phpseclib\Crypt\Base:

// vendor/phpseclib/phpseclib/phpseclib/Crypt/Base.php, line 620
function setKey($key)
{
    if (!$this->explicit_key_length) {
        $this->setKeyLength(strlen($key) << 3);
        $this->explicit_key_length = false;
    }

    $this->key = $key;
    $this->changed = true;
    $this->_setEngine();
}

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.

What 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.

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.

Format 1 was not an accident. The file's own comment said so.

The 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.

When 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:

/*
In format 1 (legacy/obsolete), the one encrypts (the shared AES key) using one half
of the key-pair, and decrypts with the other; whereas the other side of the conversation
does the reverse when replying (and uses a different shared AES key). Though this is
possible in RSA, this is the wrong thing to do - see
https://crypto.stackexchange.com/questions/2123/...
In format 2, both sides have their own private and public key. The sender encrypts using
the other side's public key, and decrypts using its own private key. Messages are signed
(the message digest is SHA-256).
*/

The 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:

if ($format >= 2) {
    if (empty($_POST['signature'])) {
        $this->log('No message signature found', 'error');
        die;
    }
    if (!$this->key_remote) {
        $this->log('No signature verification key has been set', 'error');
        die;
    }
    if (!$this->verify_signature($udrpc_message, $_POST['signature'], $this->key_remote)) {
        $this->log('Signature verification failed; discarding', 'error');
        die;
    }
}

Signature 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.

What the attacker sends, what the server runs

Preconditions: 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.

The attacker constructs the envelope encrypt_message would have produced:

[3 hex chars sym_key length][base64(garbage sym_key bytes)][16 hex chars cipher length][base64(AES-128-CBC ciphertext)]

The "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.

The 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.

The final request:

POST / HTTP/1.1
Host: target
Content-Type: application/x-www-form-urlencoded

format=1&key_name=<recovered>&udrpc_message=<envelope>

The 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.

The patch adds three lines. The same commit also removes format 1 from almost everything.

The 1.26.5 patch to decrypt_message:

        $sym_key = base64_decode($sym_key);
        $sym_key = $rsa->decrypt($sym_key);

+       if (false === $sym_key || !is_string($sym_key) || strlen($sym_key) < 16) {
+           return false;
+       }
+
        // Decrypt the message
        $rij->setKey($sym_key);

Three lines. The CVE record names them.

The same commit makes four other changes to the same file. The material one:

+       // Restrict use of format 1
+       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))) {
+               $this->log("Obsolete format used - dropping (command: $command)", 'error');
+               die;
+       }

Format 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."

The 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.

Fail open intercept, without the catch block

This pattern has a name on this blog: fail-open-intercept. The catalog already holds the Tomcat EncryptInterceptor 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.

UpdraftPlus 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.

The 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.

PoC: izxci/CVE-2026-10795

phpseclib's decrypt returns false. phpseclib's setKey accepts false. UpdraftPlus put a line between them.