{"id":"RUSTSEC-2026-0622","summary":"Timing side channel in RSA decryption: time depends on the leading zero bytes of the decrypted value","details":"After the RSA private-key operation, decryption converted the result to bytes by skipping its\nleading zero bytes and copying the rest into a buffer of the modulus size. The number of bytes\ncopied, and the offset they were copied to, depended on how many leading zero bytes the decrypted\nvalue had. That value is secret.\n\nThis affects OAEP and PKCS#1 v1.5 decryption, with and without blinding. Blinding does not help,\nbecause the conversion happens after the result is unblinded. Signing and signature verification\nare not affected.\n\nWhether the decrypted value starts with zero bytes is the information that Manger's attack on\nOAEP and Bleichenbacher-style attacks on PKCS#1 v1.5, including the Marvin attack, are built on.\n\nThe difference is measurable. With the Marvin toolkit at 200 million repetitions per class\n(RSA-2048, measured inside the decrypting process), 0.10.5 takes about 11 ns longer, on a 1.09 ms\noperation, to decrypt a ciphertext whose decrypted value starts with 208 zero bytes than any\nother class tested. No exploit is known, and the difference has not been demonstrated over a\nnetwork. Classes with one leading zero byte and with none did not differ from each other in the\nsame run.\n\nFixed in 0.10.6, where the conversion always copies the same number of bytes from the same\noffset. There is no workaround in the library; limiting how many decryptions a peer can request\nwith one key reduces the number of measurements an attacker can take.","aliases":["GHSA-7p29-gw5p-v3h6"],"modified":"2026-11-29T22:15:03.258468965Z","published":"2026-11-28T12:00:00Z","database_specific":{"license":"CC0-1.0"},"references":[{"type":"PACKAGE","url":"https://crates.io/crates/sad-rsa"},{"type":"ADVISORY","url":"https://rustsec.org/advisories/RUSTSEC-2026-0622.html"},{"type":"WEB","url":"https://github.com/sadco-io/sad-rsa/pull/77"}],"affected":[{"package":{"name":"sad-rsa","ecosystem":"crates.io","purl":"pkg:cargo/sad-rsa"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"},{"fixed":"0.10.6"}]}],"ecosystem_specific":{"affected_functions":null,"affects":{"arch":[],"os":[],"functions":["sad_rsa::RsaPrivateKey::decrypt","sad_rsa::RsaPrivateKey::decrypt_blinded"]}},"database_specific":{"informational":null,"source":"https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0622.json","categories":["crypto-failure"],"cvss":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N"}]}