CVE-2023-36308: Github.com/disintegration/imaging Crash When Processing Crafted TIFF Vulnerability

LOW
Advisory Identifier: GHSA-q7pp-wcgr-pffx
CWE-129
Published
Advisory Summary

CVE-2023-36308 is a LOW crash when processing crafted tiff vulnerability (CWE-129: Improper Validation of Array Index) affecting Github.com/disintegration/imaging libraries in the Go ecosystem. The issue involves crash when processing crafted tiff files. Remediation is available in the latest vendor maintenance releases.

CVE-2023-36308 at a Glance

CVE Identifier CVE-2023-36308
GHSA Identifier GHSA-q7pp-wcgr-pffx
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-129: Improper Validation of Array Index
Affected Product Github.com/disintegration/imaging
Package Ecosystem Go
Published Date
Last Updated

How to Fix CVE-2023-36308

To remediate this vulnerability, upgrade all affected Github.com/disintegration/imaging dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/disintegration/imaging fixed: Latest secure release
Upgrade github.com/disintegration/imaging to Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/disintegration/imaging

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-36308, inspect your project dependencies for Github.com/disintegration/imaging:

inspect dependencies for github.com/disintegration/imaging

Analyze the terminal output to locate any version of Github.com/disintegration/imaging in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-129: Improper Validation of Array Index, where the product uses untrusted input when calculating or using an array index, but the product does not validate or incorrectly validates the index to ensure the index references a valid position within the array. In Github.com/disintegration/imaging, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Disintegration Imaging 1.6.2 allows attackers to cause a panic (because of an integer index out of range during a Grayscale call) via a crafted TIFF file to the scan function of scanner.go. NOTE: it is unclear whether there are common use cases in which this panic could have any security consequence

CVE-2023-36308 Affected Github.com/disintegration/imaging Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
github.com/disintegration/imaging
Go
≤ 1.6.2

References

Frequently Asked Questions

What is CVE-2023-36308?
CVE-2023-36308 is a security vulnerability in Github.com/disintegration/imaging involving Crash when processing crafted TIFF files under CWE-129: Improper Validation of Array Index.
Which Github.com/disintegration/imaging versions are affected?
Affected versions include releases prior to current release patches across affected packages: github.com/disintegration/imaging.
What version fixes CVE-2023-36308?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/disintegration/imaging affected?
Yes, github.com/disintegration/imaging is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What CWE is associated with CVE-2023-36308?
CVE-2023-36308 is classified under CWE-129: Improper Validation of Array Index (The product uses untrusted input when calculating or using an array index, but the product does not validate or incorrectly validates the index to ensure the index references a valid position within the array.).
How can I check Go dependencies for CVE-2023-36308?
Run the dependency tree command: 'inspect dependencies for github.com/disintegration/imaging'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-q7pp-wcgr-pffx",
  "modified" : "2024-03-21T18:57:46Z",
  "published" : "2023-09-05T06:30:14Z",
  "aliases" : [ "CVE-2023-36308" ],
  "summary" : "Crash when processing crafted TIFF files",
  "details" : "Disintegration Imaging 1.6.2 allows attackers to cause a panic (because of an integer index out of range during a Grayscale call) via a crafted TIFF file to the scan function of scanner.go. NOTE: it is unclear whether there are common use cases in which this panic could have any security consequence",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/disintegration/imaging"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "1.6.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-36308"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/disintegration/imaging/issues/165"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/disintegration/imaging/releases/tag/v1.6.2"
  }, {
    "type" : "PACKAGE",
    "url" : "github.com/disintegration/imaging"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-129" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-03-21T18:57:46Z",
    "nvd_published_at" : "2023-09-05T04:15:08Z"
  }
}