|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78083 exif_read_data() corrupt EXIF header: maximum directory nesting level reached
Submitted: 2019-05-29 16:53 UTC Modified: -
Avg. Score:4.5 ± 0.8
Reproduced:6 of 6 (100.0%)
Same Version:2 (33.3%)
Same OS:1 (16.7%)
From: fermin at ares dot uy Assigned:
Status: Open Package: EXIF related
PHP Version: 7.3.5 OS: Windows 10
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: fermin at ares dot uy
New email:
PHP Version: OS:


 [2019-05-29 16:53 UTC] fermin at ares dot uy
When using the function "exif_read_data()" on certain jpg images it outputs this warning:

"Warning: exif_read_data(php7D62.tmp): corrupt EXIF header: maximum directory nesting level reached in \path\to\index.php on line 4"

And the metadata field 'title' does not show up on the resulting array.

You can download a problematic image for testing here

Test script:
if (!empty($_FILES)) {
  $imagen = $_FILES['imagen']['tmp_name'];
  $metadata = exif_read_data($imagen, 0, true);
  highlight_string("<?php\n\$metadata =\n" . var_export($metadata, true) . ";\n?>");

<!DOCTYPE html>
<html lang="en" dir="ltr">
    <meta charset="utf-8">
    <title>EXIF TEST</title>
    <form action="/" method="post" enctype="multipart/form-data">
      <input type="file" name="imagen" value="">
      <input type="submit" name="" value="Print EXIF">

Expected result:
No warning message and the complete list of metadata fields on the array outputted by the function exif_read_data.

Actual result:
Warning message and incomplete metadata array.


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Jul 04 21:01:04 2020 UTC