# CVE-2026-27809: psd-tools: Compression module has unguarded zlib decompression, missing dimension validation, and hardening gaps

> A malicious PSD file can cause a crash in psd-tools due to unhandled exceptions during RLE decompression, leading to denial of service.

- **Severity:** Medium 6.8 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/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:** 25 Feb 2026
- **Updated:** 26 Feb 2026
- **Also known as:** DEBIAN-CVE-2026-27809, GHSA-24p2-j2jr-386w, PYSEC-2026-2262, UBUNTU-CVE-2026-27809

## What is CVE-2026-27809?

CVE-2026-27809 is a medium-severity denial of service vulnerability in psd-tools, published on 25 Feb 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

psd-tools is a Python package for working with Adobe Photoshop PSD files. Prior to version 1.12.2, when a PSD file contains malformed RLE-compressed image data (e.g. a literal run that extends past the expected row size), decode_rle() raises ValueError which propagated all the way to the user, crashing psd.composite() and psd-tools export. decompress() already had a fallback that replaces failed channels with black pixels when result is None, but it never triggered because the ValueError from decode_rle() was not caught. The fix in version 1.12.2 wraps the decode_rle() call in a try/except so the existing fallback handles the error gracefully.

Weakness: CWE-789 (Memory Allocation with Excessive Size Value), CWE-755 (Improper Handling of Exceptional Conditions), CWE-704 (Incorrect Type Conversion or Cast), CWE-617 (Reachable Assertion), CWE-409 (Improper Handling of Highly Compressed Data (Data Amplification)), CWE-190 (Integer Overflow or Wraparound)

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

3 open source packages ship an affected version, including psd-tools. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `psd-tools` | PyPI | All versions | 1.12.2 |
| `psd-tools` | PyPI | All versions | 1.12.2 |
| `psd-tools` | PyPI | All versions | 1.12.2 |

Products: Psd-Tools Project Psd-Tools.

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

Upgrade psd-tools to 1.12.2 or later.

## Is CVE-2026-27809 being exploited?

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

## Other vulnerabilities in psd-tools

- [CVE-2020-10571](https://insights.sbomify.com/CVE-2020-10571/): Potential buffer overflow in psd-tools (critical 9.8)

## Fix prompt for AI coding agents

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

What it is: CVE-2026-27809 is a medium-severity denial of service vulnerability in psd-tools, published on 25 Feb 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-27809 in the wild and no public exploit code.

Affected packages and fixed versions:
- psd-tools (PyPI): affected all versions; fixed in 1.12.2
- psd-tools (PyPI): affected all versions; fixed in 1.12.2
- psd-tools (PyPI): affected all versions; fixed in 1.12.2

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

## Sources

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

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