{"id":"CVE-2026-41898","aliases":["CVE-2026-41898","GHSA-hppc-g8h3-xhp3","RUSTSEC-2026-0478"],"related":[],"kind":"vulnerability","state":"published","title":"rust-openssl: Unchecked callback-returned length in PSK and cookie generate trampolines can cause OpenSSL to leak adjacent memory to the network peer","summary":"rust-openssl provides OpenSSL bindings for the Rust programming language.  From 0.9.24 to before 0.10.78, the FFI trampolines behind SslContextBuilder::set_psk_client_callback, set_psk_server_callback, set_cookie_generate_cb, and set_stateless_cookie_generate_cb forwarded the user closure's returned usize directly to OpenSSL without checking it against the &mut [u8] that was handed to the closure. This can lead to buffer overflows and other unintended consequences. This vulnerability is fixed in 0.10.78.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"rust-openssl provides OpenSSL bindings for the Rust programming language.  From 0.9.24 to before 0.10.78, the FFI trampolines behind SslContextBuilder::set_psk_client_callback, set_psk_server_callback, set_cookie_generate_cb, and set_stateless_cookie_generate_cb forwarded the user closure's returned usize directly to OpenSSL without checking it against the &mut [u8] that was handed to the closure. This can lead to buffer overflows and other unintended consequences. This vulnerability is fixed in 0.10.78.","source":"cvelist"},{"lang":"en","text":"The FFI trampolines behind `SslContextBuilder::set_psk_client_callback`, `set_psk_server_callback`, `set_cookie_generate_cb`,  and `set_stateless_cookie_generate_cb` forwarded the user closure's returned usize directly to OpenSSL without checking it against the `&mut [u8]` that was handed to the closure. This can lead to buffer overflows and other unintended consequences.","format":"markdown","source":"ghsa"},{"lang":"en","text":"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.","format":"markdown","source":"rustsec"},{"lang":"es","text":"rust-openssl proporciona enlaces de OpenSSL para el lenguaje de programación Rust. Desde la 0.9.24 hasta antes de la 0.10.78, los trampolines FFI detrás de SslContextBuilder::set_psk_client_callback, set_psk_server_callback, set_cookie_generate_cb y set_stateless_cookie_generate_cb reenviaban el usize devuelto por el closure del usuario directamente a OpenSSL sin comprobarlo contra el ref:mut [u8] que se entregó al closure. Esto puede llevar a desbordamientos de búfer y otras consecuencias no deseadas. Esta vulnerabilidad está corregida en la 0.10.78.","source":"nvd"}],"published":"2026-04-19T12:00:00.000Z","modified":"2026-11-11T23:10:00.263Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:L/SC:N/SI:N/SA:N","score":8.3,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:L/SC:N/SI:N/SA:N","score":8.3,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:L/SC:N/SI:N/SA:N","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","score":5.3,"rating":"MEDIUM"}],"cwes":["CWE-126","CWE-130"],"affected":[{"ranges":[{"version":">= 0.9.24, < 0.10.78","status":"affected"}],"vendor":"rust-openssl","product":"rust-openssl","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.9.24","status":"affected","fixed":"0.10.78"}],"ecosystem":"crates.io","package":"openssl","purl":"pkg:cargo/openssl","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.9.24","status":"affected","fixed":"0.10.78"}],"ecosystem":"crates.io","package":"openssl","purl":"pkg:cargo/openssl","source":"rustsec"},{"ranges":[{"status":"affected","introduced":"0.9.24","fixed":"0.10.78"}],"vendor":"rust-openssl_project","product":"rust-openssl","cpe":"cpe:2.3:a:rust-openssl_project:rust-openssl:*:*:*:*:*:rust:*:*","source":"nvd"}],"references":[{"url":"https://github.com/rust-openssl/rust-openssl/security/advisories/GHSA-hppc-g8h3-xhp3","tags":["vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/rust-openssl/rust-openssl/pull/2607","tags":["issue-tracking","web","x-refsource-misc"],"sources":["cvelist","ghsa","rustsec","nvd"]},{"url":"https://github.com/rust-openssl/rust-openssl/commit/1d109020d98fff2fb2e45c39a373af3dff99b24c","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/rust-openssl/rust-openssl/releases/tag/openssl-v0.10.78","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41898","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/rust-openssl/rust-openssl","tags":["package"],"sources":["ghsa"]},{"url":"https://crates.io/crates/openssl","tags":["package"],"sources":["rustsec"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2026-0478.html","tags":["advisory"],"sources":["rustsec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-04-24T18:01:38.714Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-41898","url":"https://www.cve.org/CVERecord?id=CVE-2026-41898","licence":"CVE Terms of Use","modified":"2026-04-24T18:01:47.877Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-hppc-g8h3-xhp3","url":"https://github.com/advisories/GHSA-hppc-g8h3-xhp3","licence":"CC-BY-4.0","modified":"2026-11-10T14:10:47.500Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2026-0478","url":"https://rustsec.org/advisories/RUSTSEC-2026-0478.html","licence":"CC0-1.0","modified":"2026-11-10T14:00:02.480Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-41898","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41898","licence":"Public domain","modified":"2026-11-11T23:10:00.263Z"}],"updatedAt":"2026-11-25T22:59:19.554Z","epss":{"score":0.00291,"percentile":0.23382,"date":"2026-12-01T12:00:22.000Z"}}