2026-10-20 22:37CVE-2026-112202CPANSec
PUBLISHED5.2CWE-125

Imager::File::GIF versions before 1.006 for Perl allow out-of-bounds reads when consolidating GIF images

Imager::File::GIF versions before 1.006 for Perl allow out-of-bounds reads when consolidating GIF images.

With `gif_consolidate => 1`, palette indices from the image are used without checking the colour table's bounds. The i_readgif_low routine reads beyond the heap allocation and copies the bytes into output pixels. The default GIF reader is not affected.

The same code ships bundled in the Imager distribution.

An attacker supplying a crafted GIF can disclose adjacent heap memory through the decoded output and may crash the process.

Problem type

Affected products

< 1.006 - AFFECTED

< 1.040 - AFFECTED

References

JSON source

https://cveawg.mitre.org/api/cve/CVE-2026-112202
Click to expand
{
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "cveMetadata": {
    "cveId": "CVE-2026-112202",
    "assignerOrgId": "9b29abf9-4ab0-4765-b253-1875cd9b441e",
    "assignerShortName": "CPANSec",
    "dateUpdated": "2026-10-21T02:11:40.235Z",
    "dateReserved": "2026-10-19T10:02:31.268Z",
    "datePublished": "2026-10-20T22:37:43.477Z",
    "state": "PUBLISHED"
  },
  "containers": {
    "cna": {
      "providerMetadata": {
        "orgId": "9b29abf9-4ab0-4765-b253-1875cd9b441e",
        "shortName": "CPANSec",
        "dateUpdated": "2026-10-20T22:37:43.477Z"
      },
      "title": "Imager::File::GIF versions before 1.006 for Perl allow out-of-bounds reads when consolidating GIF images",
      "descriptions": [
        {
          "lang": "en",
          "value": "Imager::File::GIF versions before 1.006 for Perl allow out-of-bounds reads when consolidating GIF images.\n\nWith `gif_consolidate => 1`, palette indices from the image are used without checking the colour table's bounds. The i_readgif_low routine reads beyond the heap allocation and copies the bytes into output pixels. The default GIF reader is not affected.\n\nThe same code ships bundled in the Imager distribution.\n\nAn attacker supplying a crafted GIF can disclose adjacent heap memory through the decoded output and may crash the process."
        }
      ],
      "affected": [
        {
          "collectionURL": "https://cpan.org/modules",
          "packageName": "Imager-File-GIF",
          "modules": [
            "Imager::File::GIF"
          ],
          "programFiles": [
            "imgif.c"
          ],
          "programRoutines": [
            {
              "name": "i_readgif_low"
            }
          ],
          "repo": "https://github.com/tonycoz/imager",
          "defaultStatus": "unaffected",
          "versions": [
            {
              "version": "0",
              "status": "affected",
              "versionType": "custom",
              "lessThan": "1.006"
            }
          ]
        },
        {
          "collectionURL": "https://cpan.org/modules",
          "packageName": "Imager",
          "modules": [
            "Imager::File::GIF"
          ],
          "programFiles": [
            "GIF/imgif.c"
          ],
          "programRoutines": [
            {
              "name": "i_readgif_low"
            }
          ],
          "repo": "https://github.com/tonycoz/imager",
          "defaultStatus": "unaffected",
          "versions": [
            {
              "version": "0",
              "status": "affected",
              "versionType": "custom",
              "lessThan": "1.040"
            }
          ]
        }
      ],
      "problemTypes": [
        {
          "descriptions": [
            {
              "lang": "en",
              "description": "CWE-125 Out-of-bounds Read",
              "cweId": "CWE-125",
              "type": "CWE"
            }
          ]
        }
      ],
      "references": [
        {
          "url": "https://github.com/tonycoz/imager/commit/dec96f12b3d8a7fd94e86264953a5e4919dd6036.patch",
          "tags": [
            "patch"
          ]
        },
        {
          "url": "https://metacpan.org/release/TONYC/Imager-File-GIF-1.006/changes",
          "tags": [
            "release-notes"
          ]
        },
        {
          "url": "https://metacpan.org/release/TONYC/Imager-1.040/changes",
          "tags": [
            "release-notes"
          ]
        },
        {
          "url": "https://github.com/tonycoz/imager/security/advisories/GHSA-v4hp-5h6w-9897",
          "tags": [
            "vendor-advisory"
          ]
        }
      ],
      "workarounds": [
        {
          "lang": "en",
          "value": "Disable the gif_consolidate read option when processing untrusted GIF images."
        }
      ],
      "solutions": [
        {
          "lang": "en",
          "value": "Upgrade to Imager-File-GIF 1.006 or later, or to Imager 1.040 or later if the bundled copy is in use."
        }
      ],
      "credits": [
        {
          "lang": "en",
          "value": "kumar-Prakash07",
          "type": "reporter"
        }
      ]
    },
    "adp": [
      {
        "providerMetadata": {
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE",
          "dateUpdated": "2026-10-21T02:11:40.235Z"
        },
        "title": "CVE Program Container",
        "references": [
          {
            "url": "http://www.openwall.com/lists/oss-security/2026/10/21/1"
          }
        ]
      }
    ]
  }
}