CVE-2026-8814: Medium severity npm/exifreader vulnerability

Published May 19, 2026
·
Updated

Impact

Versions of ExifReader from 4.20.0 through 4.38.1 do not bound the size of decompressed metadata blocks. When a caller invokes the asynchronous API (e.g. ExifReader.load(file) or ExifReader.load(buffer, {async: true})) on an attacker-supplied image, a small compressed chunk in the file can expand to hundreds of megabytes of memory, consuming heap and CPU until the process slows down or runs out of memory.

The affected paths share a single decompression utility, so the issue is reachable through any compressed metadata block the library handles asynchronously, including:

- PNG zTXt, compressed iTXt, and iCCP chunks (deflate) - JPEG XL Brotli-compressed Exif and XMP blocks

A typical proof of concept produced roughly 1000× expansion (for example, ~32 KB of compressed input expanded to ~32 MB of output, ~130 KB to ~128 MB).

Both the npm package and the dist/ bundle published from this repository (consumed by Bower and other users of the prebuilt artifact) are affected.

Patches

Fixed in 4.39.0. The decompression utility now reads the decompressed stream incrementally and aborts as soon as the running total would exceed a configurable limit. The default cap is 128 MiB per metadata block, which is well above any realistic legitimate value. When a block exceeds the cap, that block is skipped (a warning is emitted via console.warn) and the remaining tags are returned as usual.

The cap is configurable via the new maxDecompressedSize field on the decompress option, in bytes:

javascript const tags = await ExifReader.load(file, { async: true, decompress: { maxDecompressedSize: 16 1024 1024 // 16 MiB } });

The same cap applies to results returned by user-supplied custom brotli/deflate functions.

Workarounds

- If upgrading is not possible, avoid invoking the asynchronous API on untrusted inputs. The synchronous code path skips compressed metadata blocks entirely and is not affected. Alternatively, pre-validate input files by source or size before passing them to ExifReader.

Resources

- Reporter's writeup: https://gist.github.com/yuki-matsuhashi/cad1a45d936062438b4ab24613c34c55 - Patch: https://github.com/mattiasw/ExifReader/commit/5f116128adc19f674902f8bf582bfe7dd0a36375 - README — "Limiting decompressed metadata size": https://github.com/mattiasw/ExifReader/blob/main/README.md#limiting-decompressed-metadata-size

Other sources

Versions of the package exifreader before 4.39.0 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.

NVD

Affected Software

2 affected componentsFixes available
npm/exifreader<4.39.0
npm/exifreader>=4.20.0<4.39.0
4.39.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/exifreader to a version that resolves this vulnerability.

    Fixed in 4.39.0
  2. Upgrade

    Upgrade exifreader to a version that resolves this vulnerability.

    Fixed in 4.39.0
  3. Configuration

    When using the asynchronous API (e.g., ExifReader.load(file, {async: true})), set decompress.maxDecompressedSize to a safe limit in bytes (cap is configurable via decompress.maxDecompressedSize). Example from material: maxDecompressedSize: 16 * 1024 * 1024 // 16 MiB.

    ExifReader (asynchronous API, decompression option) decompress.maxDecompressedSize = 16 * 1024 * 1024
  4. Compensating control

    If upgrading is not possible, avoid invoking the asynchronous API on untrusted inputs. Alternatively, pre-validate input files by source or size before passing them to ExifReader.

Event History

May 19, 2026
CVE Published
via MITRE·05:00 AM
Data Sourced
via MITRE·05:00 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·07:16 AM
DescriptionSeverityWeakness
May 29, 2026
Advisory Published
via GitHub·05:52 PM
Data Sourced
via GitHub·05:52 PM
DescriptionSeverityWeaknessAffected Software
May 8, 58583
Event
via FIRST·09:49 PM

Frequently Asked Questions

1

What is the severity of CVE-2026-8814?

CVE-2026-8814 is classified as a medium severity vulnerability due to improper handling of highly compressed data.

2

How do I fix CVE-2026-8814?

To fix CVE-2026-8814, upgrade the exifreader package to version 4.39.0 or higher.

3

What versions are affected by CVE-2026-8814?

CVE-2026-8814 affects versions of the exifreader package prior to 4.39.0.

4

What kind of vulnerability is CVE-2026-8814?

CVE-2026-8814 is an Improper Handling of Highly Compressed Data vulnerability that can lead to data amplification.

5

What software uses the vulnerable exifreader package related to CVE-2026-8814?

The exifreader package, which is vulnerable under CVE-2026-8814, is typically used in JavaScript applications that handle PNG images.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203