{"id":"RUSTSEC-2026-0478","summary":"Unchecked callback lengths in PSK and cookie callbacks","details":"The callbacks installed with `SslContextBuilder::set_psk_client_callback` (and its deprecated alias `set_psk_callback`), `set_psk_server_callback`, `set_cookie_generate_cb` and `set_stateless_cookie_generate_cb` each fill a `&mut [u8]` buffer and return how many bytes they wrote. The FFI trampolines handed that returned length straight to OpenSSL without checking it against the size of the buffer.\n\nA callback that returns a length larger than its buffer makes OpenSSL read past the end of the buffer. For the cookie callbacks the cookie is sent to the peer, so adjacent memory can be disclosed over the network.\n\n0.10.78 compares the returned length with the buffer size and treats a larger value as a callback failure.","aliases":["CVE-2026-41898","GHSA-hppc-g8h3-xhp3"],"modified":"2026-11-10T14:00:02.480903309Z","published":"2026-04-19T12:00:00Z","database_specific":{"license":"CC0-1.0"},"references":[{"type":"PACKAGE","url":"https://crates.io/crates/openssl"},{"type":"ADVISORY","url":"https://rustsec.org/advisories/RUSTSEC-2026-0478.html"},{"type":"WEB","url":"https://github.com/rust-openssl/rust-openssl/pull/2607"}],"affected":[{"package":{"name":"openssl","ecosystem":"crates.io","purl":"pkg:cargo/openssl"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0.9.24"},{"fixed":"0.10.78"}]}],"ecosystem_specific":{"affects":{"functions":["openssl::ssl::SslContextBuilder::set_cookie_generate_cb","openssl::ssl::SslContextBuilder::set_psk_callback","openssl::ssl::SslContextBuilder::set_psk_client_callback","openssl::ssl::SslContextBuilder::set_psk_server_callback","openssl::ssl::SslContextBuilder::set_stateless_cookie_generate_cb"],"arch":[],"os":[]},"affected_functions":null},"database_specific":{"cvss":null,"informational":null,"categories":["memory-exposure"],"source":"https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0478.json"}}],"schema_version":"1.9.2"}