Skip to main content
Mallory
← Back to News
endpoint-software-vulnerabilityproof-of-concept-releasewidely-deployed-product-advisory

PHP `getimagesize()` JPEG APPn Parsing Flaw Leaks Heap Memory

Vulnerability Disclosure · 2 sources · Updated 5mo ago · First seen May 25, 2026

PHP `getimagesize()` JPEG APPn Parsing Flaw Leaks Heap Memory

PHP disclosed an information disclosure vulnerability in getimagesize(..., $info) affecting JPEG APPn metadata parsing in php-src/ext/standard/image.c. The flaw occurs during multi-chunk reads: php_read_stream_all_chunks() can overwrite the start of the destination buffer without advancing the write pointer, leaving the tail populated with uninitialized or previously freed heap memory. When getimagesize() returns metadata such as $info['APP1'], the application may receive corrupted data containing leaked process memory.

A public proof of concept showed the bug with a crafted JPEG containing a large APP1 segment read through php://filter, using repeated filters to force chunked reads and a heap spray marker to demonstrate memory reuse inside the returned APP1 buffer. The issue was reproduced on a PHP 8.6.0-dev build with AddressSanitizer and debug flags, and the advisory said initial doubts about security impact were revised after maintainers concluded exploitation may also be possible with normal image files if an attacker can predict stream chunk sizes.

Do you run this?See affected versions and whether adversaries are exploiting it.
Check your exposure
Event timeline

How this story unfolded

Events from the most recent confirmed update back to the earliest known activity.

3 events · Nov 25, 2025 – Dec 18, 2025
  1. Dec 18, 202511mo ago

    PHP publishes security advisory for getimagesize() information leak

    GitHub published a security advisory for php/php-src describing the zero-day information leak and noting that exploitation might be possible on normal images if an attacker can predict stream chunk sizes. The advisory also documented the root cause in php_read_stream_all_chunks() behavior during chunked reads.

  2. Dec 18, 202511mo ago

    Researcher reports PHP getimagesize() memory disclosure vulnerability

    A researcher reported an information disclosure flaw in PHP's getimagesize(..., $info) JPEG APPn metadata parsing in ext/standard/image.c. The issue involved multi-chunk reads corrupting the returned APPn buffer and potentially exposing uninitialized heap memory.

  3. Nov 25, 20251y ago

    Public GitHub issue shares PoC demonstrating leaked heap marker data

    A public php/php-src issue disclosed a proof of concept showing getimagesize() returning corrupted APP1 JPEG metadata and reusing heap contents, including a sprayed marker string found in the returned buffer. The report showed reproduction on a PHP 8.6.0-dev build with AddressSanitizer and debug flags using php://filter to force chunked reads.

Linked entities

Related entities

Vulnerabilities, threat actors, malware, products, organizations, and breaches Mallory has linked to this story.

Open in app →

Affected products

1 linked
Php
Do you run this?See whether adversaries are exploiting this yet, and where the affected versions run in your environment.
Check Your Exposure
Mallory platform

See the full picture, correlated to your attack surface.

This page covers what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which threat actors are using it right now, and what to deploy next.

Exposure mappingMap indicators from this story to your assets and identify affected systems in minutes.
Threat actor evidenceEvery observed campaign, victim, and pivot linked to actors named in this story.
Associated malwareMalware, exploits, and IOCs connected to the activity described here.
Detection signaturesYARA, Sigma, and Snort rules deployed to your SIEM as soon as they’re published.
Scheduled alertsGet matching new stories delivered to your team as they break, not the next morning.
AI threadsAsk questions about this story and take action on the answers.