# CVE-2025-9820: Gnutls: stack-based buffer overflow in gnutls_pkcs11_token_init() function

> A stack-based buffer overflow in GnuTLS allows attackers to cause denial of service or execute arbitrary code via crafted PKCS#11 token labels.

- **Severity:** Medium 4.0 (`CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 26 Jan 2026
- **Updated:** 14 Oct 2026
- **Also known as:** ALPINE-CVE-2025-9820, AZL-75258, AZL-75261, BELL-CVE-2025-9820, CLSA-2026-1775224602, DEBIAN-CVE-2025-9820, ECHO-ab0e-9ddf-13e5, GHSA-337w-h8w7-m899, MGASA-2025-0317, OESA-2026-1043, OESA-2026-1044, OESA-2026-1045, OESA-2026-1046, OESA-2026-1417, SUSE-SU-2025:21202-1, SUSE-SU-2025:21222-1, SUSE-SU-2025:4271-1, SUSE-SU-2025:4272-1, SUSE-SU-2025:4323-1, SUSE-SU-2025:4346-1, SUSE-SU-2025:4525-1, UBUNTU-CVE-2025-9820, openSUSE-SU-2025:15765-1

## What is CVE-2025-9820?

CVE-2025-9820 is a medium-severity memory corruption vulnerability in Cert Manager support for Red Hat OpenShift release 1.18, published on 26 Jan 2026. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

A flaw was found in the GnuTLS library, specifically in the gnutls_pkcs11_token_init() function that handles PKCS#11 token initialization. When a token label longer than expected is processed, the function writes past the end of a fixed-size stack buffer. This programming error can cause the application using GnuTLS to crash or, in certain conditions, be exploited for code execution. As a result, systems or applications relying on GnuTLS may be vulnerable to a denial of service or local privilege escalation attacks.

Weakness: CWE-121 (Stack-based Buffer Overflow)

## Which versions are affected by CVE-2025-9820?


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `gnutls` | SUSE:Linux Enterprise Micro 5.2 | All versions | 3.6.7-150200.14.40.1 |
| `gnutls` | SUSE:Linux Enterprise Micro 5.3 | All versions | 3.7.3-150400.19.1 |
| `gnutls` | SUSE:Linux Enterprise Micro 5.4 | All versions | 3.7.3-150400.4.53.1 |
| `gnutls` | SUSE:Linux Enterprise Micro 5.5 | All versions | 3.7.3-150400.4.53.1 |
| `gnutls` | SUSE:Linux Enterprise Module for Basesystem 15 SP6 | All versions | 3.8.3-150600.4.12.1 |
| `gnutls` | SUSE:Linux Enterprise Module for Basesystem 15 SP7 | All versions | 3.8.3-150600.4.12.1 |
| `gnutls` | SUSE:Linux Enterprise Server LTSS Extended Security 12 SP5 | All versions | 3.3.27-3.15.1 |
| `gnutls` | SUSE:Linux Micro 6.0 | All versions | 3.8.3-5.1 |
| `gnutls` | SUSE:Linux Micro 6.1 | All versions | 3.8.3-slfo.1.1_5.1 |
| `gnutls` | openSUSE:Leap 15.6 | All versions | 3.8.3-150600.4.12.1 |
| `gnutls` | openSUSE:Tumbleweed | All versions | 3.8.11-1.1 |

## How do I fix CVE-2025-9820?

Apply the vendor's patch.

## Is CVE-2025-9820 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-9820 and fix it if it is affected.

What it is: CVE-2025-9820 is a medium-severity memory corruption vulnerability in Cert Manager support for Red Hat OpenShift release 1.18, published on 26 Jan 2026. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2025-9820 in the wild and no public exploit code.

Affected product: Cert Manager support for Red Hat OpenShift release 1.18. No package-level version data is available, so check the vendor advisory linked from the reference page.

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-2025-9820/ (Markdown: https://insights.sbomify.com/CVE-2025-9820/index.md)
```

## Sources

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

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