The MSP RLE decoder expands run-length data into an in-memory buffer with no cap tied to the declared image size. A small file that passes the pixel-count check can force hundreds of megabytes or more of allocation when the application loads pixels.
The MSP decoder writes each run into an unbounded io.BytesIO and can expand roughly 85x per run:
src/PIL/MspImagePlugin.py:144-146Memory-exhaustion denial of service from a tiny crafted image in any application that loads pixels. The expansion is decoupled from the declared pixel count, so MAX_IMAGE_PIXELS does not bound it.
{
"cwe_ids": [
"CWE-409"
],
"github_reviewed": true,
"github_reviewed_at": "2026-10-21T21:12:56Z",
"nvd_published_at": "2026-10-19T22:17:09Z",
"severity": "HIGH"
}