CVE-2026-18374: GNU C Library heap buffer overflow in fopen ccs= handling

CVE-2026-18374 · Severity: medium · CVSS 4.9 · Published 2026-08-27

The GNU C Library's fopen() function is used by nearly all C programs on Linux systems to open files. A flaw in how it processes the character set conversion (`ccs=`) mode parameter can cause a heap buffer overflow when an application passes an attacker-controlled empty string in that parameter. While this pattern is uncommon in standard Linux distributions, exploits could corrupt memory, leading to crashes, information disclosure, or potential code execution in applications that fail to validate this input.

Technologies: Gnu C Library. Vendors: Gnu.

Quick answers

Is CVE-2026-18374 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-18374 being exploited in the wild.
How severe is CVE-2026-18374?
Medium severity, with a CVSS score of 4.9, published 27 August 2026.
Which products and versions are affected?
Gnu C Library 2.45 and earlier.
Is there a fix for CVE-2026-18374?
A patch was published on 2026-09-04: Patches applied to glibc master and release branches 2.42–2.45 Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-18374 attacked?
It is attacked with local access, in a software library.
Am I affected by CVE-2026-18374?
Check whether you run Gnu C Library at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

Technical details

The vulnerability is a heap buffer overflow in the libio stdio implementation within glibc's fopen() function. The vulnerable code fails to properly validate the `ccs=` (character set conversion specification) parameter when it becomes empty after whitespace stripping. An attacker who controls the mode argument passed to fopen() can supply an empty ccs value (e.g., `"w,ccs= ,"`), causing the code to read and write past buffer boundaries. The attack requires local access and direct control over the fopen mode parameter; this is not typical in common Linux distributions. Patches were released in glibc 2.42, 2.43, 2.44, and 2.45, adding validation to reject empty charset specifications with EINVAL.

Affected products

  • GNU C Library 2.45 and earlier

Timeline

  • 2026-08-27: disclosed
  • 2026-09-04: patched: Patches applied to glibc master and release branches 2.42–2.45

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.