CVE-2026-41898: Rust Openssl Ffi Trampoline Unchecked Callback Length

FFI trampoline forwards a Rust closure's returned `usize` length directly to OpenSSL (cast to `c_uint`/`size_t`/`u32`) without first comparing it against the length of the `&mut [u8]` slice that was handed to the closure. A buggy or attacker-influenced closure can return a length larger than the slice, causing OpenSSL to read past the buffer and serialize ad

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0Rust
greprules fetch cve-2026-41898-rust-openssl-ffi-trampoline-unchecked-callback-length --engine opengrep

Description

FFI trampoline forwards a Rust closure's returned `usize` length directly to OpenSSL (cast to `c_uint`/`size_t`/`u32`) without first comparing it against the length of the `&mut [u8]` slice that was handed to the closure. A buggy or attacker-influenced closure can return a length larger than the slice, causing OpenSSL to read past the buffer and serialize ad