# CVE-2026-41676: rust-openssl: Deriver::derive and PkeyCtxRef::derive can overflow short buffers on OpenSSL 1.1.1

> Attackers can trigger heap or stack overflows via buffer mismanagement in key derivation, potentially leading to code execution or crashes.

- **Severity:** High 7.2 (`CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:U`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 24 Apr 2026
- **Updated:** 24 Apr 2026
- **Also known as:** AZL-83618, DEBIAN-CVE-2026-41676, GHSA-pqf5-4pqq-29f5, MINI-5j43-74cc-qv3m, MINI-7jfp-pm77-w73v, MINI-933m-gpf6-qpwc, MINI-c32g-c38m-cjv9, MINI-c73x-f4gh-jg54, MINI-p9vr-4w3j-72c5, MINI-vhcm-cr85-prm7, MINI-w3p5-fpx2-rv6g, SUSE-SU-2026:22737-1, SUSE-SU-2026:22910-1, SUSE-SU-2026:2777-1, SUSE-SU-2026:3474-1, SUSE-SU-2026:3475-1, UBUNTU-CVE-2026-41676, openSUSE-SU-2026:11194-1, openSUSE-SU-2026:11205-1, openSUSE-SU-2026:11206-1

## What is CVE-2026-41676?

CVE-2026-41676 is a high-severity memory corruption vulnerability in rust-openssl, published on 24 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

rust-openssl provides OpenSSL bindings for the Rust programming language.  From 0.9.27 to before 0.10.78, Deriver::derive (and PkeyCtxRef::derive) sets len = buf.len() and passes it as the in/out length to EVP_PKEY_derive, relying on OpenSSL to honor it. On OpenSSL 1.1.x, X25519, X448, DH and HKDF-extract ignore the incoming *keylen, unconditionally writing the full shared secret (32/56/prime-size bytes). A caller passing a short slice gets a heap/stack overflow from safe code. OpenSSL 3.x providers do check, so this only impacts older OpenSSL. This vulnerability is fixed in 0.10.78.

Weakness: CWE-787 (Out-of-bounds Write), CWE-131 (Incorrect Calculation of Buffer Size)

## Which versions are affected by CVE-2026-41676?

2 open source packages ship an affected version, including openssl. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `openssl` | crates.io | From 0.9.27 | 0.10.78 |
| `openssl` | crates.io | From 0.9.27 | 0.10.78 |
| `s390-tools` | SUSE:Linux Enterprise Micro 5.3 | All versions | 2.31.0-150400.7.34.1 |
| `s390-tools` | SUSE:Linux Enterprise Micro 5.4 | All versions | 2.31.0-150400.7.34.1 |
| `s390-tools` | SUSE:Linux Enterprise Micro 5.5 | All versions | 2.31.0-150500.9.32.1 |
| `cryptsetup` | SUSE:Linux Enterprise Module for Basesystem 15 SP7 | All versions | 2.8.4-150700.6.4.4 |
| `s390-tools` | SUSE:Linux Enterprise Module for Basesystem 15 SP7 | All versions | 2.41.0-150700.4.26.2 |
| `s390-tools` | SUSE:Linux Micro 6.0 | All versions | 2.31.0-4.1 |
| `s390-tools` | SUSE:Linux Micro 6.1 | All versions | 2.31.0-slfo.1.1_4.1 |
| `rustup` | openSUSE:Tumbleweed | All versions | 1.28.2~0-4.1 |
| `sccache` | openSUSE:Tumbleweed | All versions | 0.16.0~0-2.1 |
| `sdbootutil` | openSUSE:Tumbleweed | All versions | 1+git20260706.f9f4faf-1.1 |

Products: Rust-Openssl Project Rust-Openssl.

## How do I fix CVE-2026-41676?

Upgrade openssl to 0.10.78 or later.

## Is CVE-2026-41676 being exploited?

There is no known exploitation of CVE-2026-41676 in the wild and no public exploit code.

## Other vulnerabilities in rust-openssl

- [CVE-2018-20997](https://insights.sbomify.com/CVE-2018-20997/): Use after free in openssl (critical 9.8)
- [CVE-2026-41898](https://insights.sbomify.com/CVE-2026-41898/): rust-openssl: Unchecked callback length in PSK/cookie trampolines leaks adjacent memory to peer (high 8.3)
- [CVE-2026-41681](https://insights.sbomify.com/CVE-2026-41681/): rust-openssl: MdCtxRef::digest_final() writes past caller buffer with no length check (high 8.1)
- [CVE-2016-10931](https://insights.sbomify.com/CVE-2016-10931/): Improper Certificate Validation in openssl (high 8.1)
- [CVE-2026-41678](https://insights.sbomify.com/CVE-2026-41678/): rust-openssl: Incorrect bounds assertion in aes key wrap (high 7.2)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-41676 and fix it if it is affected.

What it is: CVE-2026-41676 is a high-severity memory corruption vulnerability in rust-openssl, published on 24 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-41676 in the wild and no public exploit code.

Affected packages and fixed versions:
- openssl (crates.io): affected from 0.9.27; fixed in 0.10.78
- openssl (crates.io): affected from 0.9.27; fixed in 0.10.78

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-41676/ (Markdown: https://insights.sbomify.com/CVE-2026-41676/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-41676
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-41676
- OSV: https://osv.dev/vulnerability/CVE-2026-41676

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-41676/
Summaries are generated and may contain mistakes; the official description above is the record.
