{"id":"GHSA-pm66-mrhh-2gmp","aliases":["GHSA-pm66-mrhh-2gmp","RUSTSEC-2026-0621"],"related":[],"kind":"vulnerability","state":"published","title":"Panic in RSASSA-PSS verification with automatic salt length on small public keys","summary":"RSASSA-PSS signature verification can panic when the salt length is detected from the signature\nand the public key is too small for the hash function.\n\nThis affects verification through `pss::VerifyingKey::new_with_auto_salt_len`, and through\n`RsaPublicKey::verify` with a `Pss` whose `salt_len` is `None`. Verification with a fixed salt\nlength is not affected. PKCS#1 v1.5 signatures, encryption and decryption are not affected.\n\nThe panic happens when the modulus is at most `8 * hLen + 9` bits, where `hLen` is the output\nsize of the hash in bytes: 521 bits with SHA-512, 393 bits with SHA-384, 265 bits with SHA-256.\nThe attacker needs to supply the public key and a signature whose encoded message ends in the\nbyte `0xBC`. No private key is needed.\n\nAn application that verifies PSS signatures with automatic salt length against public keys it\ndoes not control, and that does not enforce a minimum key size, can lose a worker, or the whole\nprocess when built with `panic = \"abort\"`.\n\nFixed in 0.10.6, where verification returns an error when the encoded message is too short to\nhold the hash.\n\nIf you cannot upgrade, reject public keys with a modulus below 1024 bits before verifying, or\nverify with a fixed salt length, or wrap verification in `catch_unwind` when panics unwind.","summaryFormat":"markdown","summarySource":"rustsec","descriptions":[{"lang":"en","text":"RSASSA-PSS signature verification can panic when the salt length is detected from the signature\nand the public key is too small for the hash function.\n\nThis affects verification through `pss::VerifyingKey::new_with_auto_salt_len`, and through\n`RsaPublicKey::verify` with a `Pss` whose `salt_len` is `None`. Verification with a fixed salt\nlength is not affected. PKCS#1 v1.5 signatures, encryption and decryption are not affected.\n\nThe panic happens when the modulus is at most `8 * hLen + 9` bits, where `hLen` is the output\nsize of the hash in bytes: 521 bits with SHA-512, 393 bits with SHA-384, 265 bits with SHA-256.\nThe attacker needs to supply the public key and a signature whose encoded message ends in the\nbyte `0xBC`. No private key is needed.\n\nAn application that verifies PSS signatures with automatic salt length against public keys it\ndoes not control, and that does not enforce a minimum key size, can lose a worker, or the whole\nprocess when built with `panic = \"abort\"`.\n\nFixed in 0.10.6, where verification returns an error when the encoded message is too short to\nhold the hash.\n\nIf you cannot upgrade, reject public keys with a modulus below 1024 bits before verifying, or\nverify with a fixed salt length, or wrap verification in `catch_unwind` when panics unwind.","format":"markdown","source":"rustsec"}],"published":"2026-11-28T12:00:00.000Z","modified":"2026-11-29T21:45:02.591Z","severity":{"scorer":"RustSec Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":5.3,"rating":"MEDIUM"},"severities":[{"scorer":"RustSec Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":5.3,"rating":"MEDIUM"}],"cwes":[],"affected":[{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"0.10.6"}],"ecosystem":"crates.io","package":"sad-rsa","purl":"pkg:cargo/sad-rsa","source":"rustsec"}],"references":[{"url":"https://crates.io/crates/sad-rsa","tags":["package"],"sources":["rustsec"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2026-0621.html","tags":["advisory"],"sources":["rustsec"]},{"url":"https://github.com/sadco-io/sad-rsa/pull/77","tags":["web"],"sources":["rustsec"]}],"credits":[],"sources":[{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2026-0621","url":"https://rustsec.org/advisories/RUSTSEC-2026-0621.html","licence":"CC0-1.0","modified":"2026-11-29T21:45:02.591Z"}],"updatedAt":"2026-11-29T21:57:25.728Z"}