Project

General

Profile

Actions

Bug #1216

closed

destroyUserInformationLists() leaks ExtNeg sub-items

Added by Michael Onken 11 days ago. Updated 2 days ago.

Status:
Closed
Priority:
High
Assignee:
Category:
-
Target version:
-
Start date:
2026-05-27
Due date:
% Done:

0%

Estimated time:
Module:
dcmnet
Operating System:
Compiler:

Description

Bug as reported by Abhinav Agarwal:

Root cause: helpers.cc:67 does `delete userInfo->extNegList` which frees the OFList container but never iterates members. SOPClassExtendedNegotiationSubItem objects and their serviceClassAppInfo buffers are permanently orphaned. The correct cleanup (deleteListMembers in extneg.cc:26-36) is only called on the success path.

Reproduced with: A-ASSOCIATE-RQ with 10,911 valid 0x56 items + 1 truncated 5-byte trigger. parseExtNeg() fails at dulparse.cc:826 (availData < 6). storescp --single-process (default mode): 238 connections → 256 MB cumulative heap → SIGKILL (exit -9); post-attack C-ECHO: REFUSED; ~1.0 second at 254 conn/s; ~862 KB/conn. (256 MB limit via memory-capping harness; the bug causes monotonic growth at any limit.)

Scope: Any long-lived dcmnet SCP. storescp defaults to single-process. Fork mode mitigates (child exit reclaims).

Source:
https://github.com/DCMTK/dcmtk/blob/ccfd10b84ff3c9a40b7b331698aedf06d421fc43/dcmnet/libsrc/helpers.cc#L54-L73 (leak — line 67)
https://github.com/DCMTK/dcmtk/blob/ccfd10b84ff3c9a40b7b331698aedf06d421fc43/dcmnet/libsrc/dulparse.cc#L820-L857 (trigger — parseExtNeg)
https://github.com/DCMTK/dcmtk/blob/ccfd10b84ff3c9a40b7b331698aedf06d421fc43/dcmnet/libsrc/extneg.cc#L26-L36 (correct cleanup — never called on error path)

Actions #1

Updated by Michael Onken 11 days ago

  • Priority changed from Normal to High
Actions #2

Updated by Michael Onken 9 days ago

  • Status changed from New to Closed

Fixed with commit 23f181.

Actions #3

Updated by Michael Onken 2 days ago

  • Private changed from Yes to No
Actions

Also available in: Atom PDF