# CVE-2025-46333: z2d OOB composition could lead to invalid memory access and corruption

- Severity: High 7.3 (CVSS:4.0, scored by GitHub_M) `CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:P/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.18%, higher than 8% of CVEs (2026-12-01)
- Published: 2025-04-25T20:20:22.202Z
- Modified: 2026-06-17T09:26:15.190Z
- Weaknesses: CWE-119, CWE-122, CWE-190
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: GitHub_M

## Description

z2d is a pure Zig 2D graphics library. Versions of z2d after `0.5.1` and up to and including `0.6.0`, when writing from one surface to another using `z2d.compositor.StrideCompositor.run`, and higher-level operations when the anti-aliasing mode is set to `.default` (such as `Context.fill`, `Context.stroke`, `painter.fill`, and `painter.stroke`), the source surface can be completely out-of-bounds on the x-axis, but not on the y-axis, by way of a negative offset. This results in an overflow of the value controlling the length of the stride. In non-safe optimization modes (consumers compiling with `ReleaseFast` or `ReleaseSmall`), this could potentially lead to invalid memory accesses or corruption.

This issue is patched in version `0.6.1`. Users on an untagged version after `v0.5.1` and before `v0.6.1` are advised to update to address the vulnerability. Those still on Zig `0.13.0` are recommended to downgrade to `v0.5.1`.

(As written by CVE List.)

## Affected

- vancluever z2d: > 0.5.1, <= 0.6.0

## References

- <https://github.com/vancluever/z2d/security/advisories/GHSA-mm4c-p35v-7hx3>
- <https://github.com/vancluever/z2d/issues/104>
- <https://github.com/vancluever/z2d/issues/105>

## Sources

- CVE List: [CVE-2025-46333](https://www.cve.org/CVERecord?id=CVE-2025-46333), CVE Terms of Use, modified 2025-04-28
- NVD: [CVE-2025-46333](https://nvd.nist.gov/vuln/detail/CVE-2025-46333), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2025-46333 · Whole record: https://cve.day/CVE-2025-46333.json · Rebuilt by cve.day 2026-11-25T22:58:56.938Z
