Out of Bounds Memory Read in php_jpg_get16
The PHP EXIF extension could read past the end of an allocated buffer when parsing EXIF data from a crafted image via exif_read_data(). An attacker could use this to disclose information or crash the process.
Originally disclosed on HackerOne
- Triaged in 4 days
- Fixed in 14 months
- Paid in 14 months
- Disclosed after 15 months
I have found and reported an out of bounds memory read in PHP [php_jpg_get16] When PHP EXIF extension is parsing EXIF information from an image, e.g. via exif_read_data() function, in PHP versions 7.1.x below 7.1.30, 7.2.x below 7.2.19 and 7.3.x below 7.3.6 it is possible to supply it with data what will cause it to read past the allocated buffer. This has been fixed and assigned CVE-2019-11040 The bug report is here: https://bugs.php.net/bug.php?id=77988 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-11040 https://nvd.nist.gov/vuln/detail/CVE-2019-11040
Impact
This may lead to information disclosure or crash.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
This may lead to information disclosure or crash.
What the attacker needed
Ability to supply an image to exif_read_data()
The fix
It was fixed; affected versions were below 7.1.30, 7.2.19 and 7.3.6.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When a program reads a file, it reserves a fixed area of memory for the data. If it trusts a size value in the file and reads beyond that area, it can pick up unrelated memory contents or crash. Here a crafted image made the EXIF parser read past its buffer.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.