# CVE-2026-53720: pymonocypher: Potential heap buffer overflow on nb_blocks in argon2i_32 when provided buffer is too small

> Heap buffer overflow in pymonocypher's argon2i_32 allows attackers to corrupt memory and potentially execute code if a small buffer is provided.

- **Severity:** Medium 5.1 (`CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N`)
- **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:** 3 Sep 2026
- **Updated:** 3 Sep 2026
- **Also known as:** GHSA-8f95-v3jq-cj86, PYSEC-2026-3000

## What is CVE-2026-53720?

CVE-2026-53720 is a medium-severity memory corruption vulnerability in jetperch pymonocypher, published on 3 Sep 2026. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

pymonocypher uses cython to wrap the Monocypher C library. Prior to version 4.0.2.8, the argon2i_32 implementation does not check the nb_blocks size. If the caller does not provide a sufficiently large buffer based on the API contract, then argon2i_32 will write past the end of the buffer and possibly corrupt the heap. This issue has been patched in version 4.0.2.8.

Weakness: CWE-787 (Out-of-bounds Write), CWE-1284 (Improper Validation of Specified Quantity in Input), CWE-122 (Heap-based Buffer Overflow)

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

3 open source packages ship an affected version, including pymonocypher.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `pymonocypher` | PyPI | All versions | 4.0.2.8 |
| `pymonocypher` | PyPI | All versions | 4.0.2.8 |
| `pymonocypher` | PyPI | All versions | 4.0.2.8 |

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

Upgrade pymonocypher to 4.0.2.8 or later.

## Is CVE-2026-53720 being exploited?

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

## Fix prompt for AI coding agents

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

What it is: CVE-2026-53720 is a medium-severity memory corruption vulnerability in jetperch pymonocypher, published on 3 Sep 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-2026-53720 in the wild and no public exploit code.

Affected packages and fixed versions:
- pymonocypher (PyPI): affected all versions; fixed in 4.0.2.8
- pymonocypher (PyPI): affected all versions; fixed in 4.0.2.8
- pymonocypher (PyPI): affected all versions; fixed in 4.0.2.8

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

## Sources

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

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