CVE-2026-96778

Source
https://cve.org/CVERecord?id=CVE-2026-96778
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-96778.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2026-96778
Aliases
Downstream
CGA (16)
DEBIAN (1)
ECHO (1)
Published
2026-10-21T20:58:24Z
Modified
2026-10-23T07:29:28Z
Severity
  • 7.7 (High) CVSS_V4 - CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N CVSS Calculator
Summary
Pillow: Heap buffer overflow writing JPEG comment after ICC profile fills buffer
Details

Pillow is a Python imaging library. From 9.4.0 until 13.0.0, ImagingJpegEncode() in src/libImaging/JpegEncode.c can call jpeg_write_marker() for a JPEG COM comment when an ICC profile has exactly filled the 65536-byte encoder buffer. libjpeg writes one byte before checking the exhausted free_in_buffer counter, which then wraps and permits the attacker-controlled comment and subsequent compressed image data to overwrite adjacent heap memory. Re-saving an untrusted image as JPEG while preserving its ICC profile and forwarded comment can crash the process and may enable code execution in suitable runtime and heap layouts. This issue is fixed in version 13.0.0.

Database specific
{
    "cna_assigner":  "GitHub_M",
    "cwe_ids":  [
        "CWE-787"
    ],
    "osv_generated_from":  "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/96xxx/CVE-2026-96778.json"
}
References

Affected packages

Git / github.com/python-pillow/pillow

Affected ranges

Type
GIT
Repo
https://github.com/python-pillow/pillow
Events
Database specific
Show details
{
    "extracted_events":  [
        {
            "range":  [
                {
                    "introduced":  "9.4.0"
                },
                {
                    "fixed":  "13.0.0"
                }
            ],
            "source":  "AFFECTED_FIELD",
            "strategy":  "StringRangeExpression"
        },
        {
            "range":  [
                {
                    "fixed":  "02561b8dc6117d5670d4b469fecdd02c70854f9b"
                }
            ],
            "source":  "REFERENCES_COMMIT"
        },
        {
            "original_tag":  "13.0.0",
            "range":  [
                {
                    "fixed":  "293218ad059d994baf1777d882911bed6a49704a"
                }
            ],
            "source":  "REFERENCES_TAG"
        }
    ]
}

Affected versions

10.*
10.0.0
10.1.0
10.2.0
10.3.0
10.4.0
11.*
11.0.0
11.1.0
11.2.1
11.3.0
12.*
12.0.0
12.1.0
12.2.0
12.3.0
9.*
9.4.0
9.5.0

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-96778.json"
vanir_signatures
[
    {
        "deprecated":  false,
        "digest":  {
            "line_hashes":  [
                "304790745875795830553613601394614802230",
                "195766052794353426456429793963015413101",
                "194650945846640120368224742732753912316",
                "264074942676309556986207292165786977212"
            ],
            "threshold":  0.9
        },
        "id":  "CVE-2026-96778-8dc653c7",
        "signature_type":  "Line",
        "signature_version":  "v1",
        "source":  "https://github.com/python-pillow/pillow/commit/02561b8dc6117d5670d4b469fecdd02c70854f9b",
        "target":  {
            "file":  "src/libImaging/JpegEncode.c"
        }
    },
    {
        "deprecated":  false,
        "digest":  {
            "function_hash":  "298514932170171369325555974869916444829",
            "length":  6490
        },
        "id":  "CVE-2026-96778-99119d1c",
        "signature_type":  "Function",
        "signature_version":  "v1",
        "source":  "https://github.com/python-pillow/pillow/commit/02561b8dc6117d5670d4b469fecdd02c70854f9b",
        "target":  {
            "file":  "src/libImaging/JpegEncode.c",
            "function":  "ImagingJpegEncode"
        }
    }
]
vanir_signatures_modified
"2026-10-23T07:29:28Z"