CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2025-4056

GLib's Windows Woes: The 2GB Signed Integer Overflow

Amit Schendel
Amit Schendel
Senior Security Researcher

Feb 2, 2026·7 min read·21 visits

Executive Summary (TL;DR)

GLib, the utility library powering GNOME and countless other projects, contained a signed integer overflow in its Windows process spawning helper. If an attacker forces an application to spawn a subprocess with a command line string exceeding ~2GB, the length counter overflows. This results in a tiny heap allocation followed by a massive copy operation, obliterating the heap. Patched in version 2.84.1.

A classic integer overflow vulnerability in GLib's Windows-specific process spawning logic allows attackers to cause a heap-based buffer overflow. By supplying an argument string approaching 2GB in length, the signed integer length calculation wraps around, leading to an undersized memory allocation and subsequent heap corruption. While primarily a Denial of Service vector, the underlying memory corruption makes this a dangerous flaw in core infrastructure code.

The Hook: Windows is special (and not in a good way)

If you've ever written cross-platform code, you know the drill: Unix-like systems are elegant. You pass an array of strings (argv[]) to execve, and the kernel handles the rest. It's clean, precise, and logical.

Then there's Windows. On Windows, the process creation API (CreateProcess) doesn't take an array of arguments. It takes a single, massive command-line string. It is up to the caller to concatenate, quote, and escape every single argument perfectly so that the child process can parse them back out again. It is a legacy nightmare that has haunted developers since the 90s.

GLib, being the helpful abstraction layer it is, tries to hide this madness from you. The functions protect_argv_string inside glib/gspawn-win32.c are designed to take your nice, clean argument list and mangle it into a Windows-compatible command line string. It handles the quotes, the backslashes, and the weird edge cases.

But here's the kicker: The developers assumed that nobody in their right mind would ever try to pass a command line string longer than what a standard signed 32-bit integer could hold. They were wrong. And because C lets you shoot your own foot off with signed math, we have CVE-2025-4056.

The Flaw: Signed Integers are the Devil's Plaything

The vulnerability lives deep inside glib/gspawn-win32.c. The function protect_argv_string is responsible for iterating through the arguments and calculating how much memory is needed to hold the final, escaped command line string.

Here is the fatal mistake: The variable len was declared as a gint. In GLib land, gint is a standard signed int (usually 32-bit). The maximum positive value a signed 32-bit integer can hold is 2,147,483,647.

So, what happens if we feed it 2,147,483,648 bytes of data? In binary, that's a 1 followed by 31 zeros. In a signed 32-bit context, that isn't a large number; it's -2,147,483,648. The counter wraps around to negative.

Because the code didn't check for this overflow, it happily calculates a negative length. But memory allocators don't take negative numbers. When g_malloc receives this "negative" number, it is cast to size_t (unsigned). If the wrap-around results in a small negative number (like -50), the cast makes it a massive unsigned number, and the allocation fails safely (OOM).

However, if the math wraps just right (or if subsequent addition operations bring it back to a small positive number), we get a tiny allocation. Specifically, the code performs len + 1. If len has overflowed to something ridiculous, the allocation size becomes unpredictable and usually far too small for the data we are about to copy into it.

The Code: The Smoking Gun

Let's look at the actual code before the patch. This is a textbook example of why types matter.

// glib/gspawn-win32.c (VULNERABLE)
static gchar *
protect_argv_string (const gchar *string)
{
  const gchar *p = string;
  gchar *retval, *q;
  gint len = 0; // <--- ERROR: Signed 32-bit integer
  gint pre_bslash = 0;
 
  while (*p) {
      if (*p == '\"') len++;
      if (*p == '\\') pre_bslash++;
      else {
          len += pre_bslash;
          pre_bslash = 0;
      }
      len++; // <--- ERROR: Unchecked increment
      p++;
  }
 
  // If len overflowed, it might be negative here.
  retval = g_malloc (len + 1);
  // ... strcpy ensues ...
}

The fix, implemented in commit f1a498e178709dcd5c26303a5b54ae5007733fc5, is delightfully simple but critical. It promotes the counters to size_t (which is 64-bit on modern Windows builds) and uses g_new which has built-in overflow protection for the allocation size calculation.

// glib/gspawn-win32.c (PATCHED)
static gchar *
protect_argv_string (const gchar *string)
{
  const gchar *p = string;
  gchar *retval, *q;
  gsize len = 0; // <--- FIX: size_t (unsigned, architecture width)
  gsize pre_bslash = 0;
 
  // ... same loop logic ...
 
  // FIX: g_new checks for multiplication overflows, though here we just need the size check
  retval = g_new (gchar, len + 1);
}

By switching to gsize (alias for size_t), the counter on a 64-bit system can now count up to 18,446,744,073,709,551,615. If you are passing an 18-exabyte string to a process, you have bigger problems than a buffer overflow.

The Exploit: Crashing the Party

Exploiting this requires the attacker to control the input to a GLib application that eventually calls g_spawn_*. This isn't as rare as it sounds. Think of a server-side application that wraps a CLI tool (like git or ffmpeg) and takes user input as arguments.

The Attack Chain:

  1. Preparation: The attacker constructs a payload consisting of a massive string. It doesn't need to be complex; just long. A sequence of 'A's repeated 2GB + 100 bytes times works.
  2. Delivery: The attacker sends this via an upload, a long HTTP header, or a configuration file.
  3. The Trigger: The vulnerable application calls g_spawn_async.
  4. The Overflow: protect_argv_string iterates the string. len hits INT_MAX, wraps to INT_MIN, and continues counting up toward zero.
  5. The Allocation: Suppose len ends up at 100 after the loop finishes (due to the wrap-around). g_malloc(101) is called. The heap manager happily hands over 101 bytes.
  6. The Corruption: The code then proceeds to copy the original 2GB+ string into that 101-byte buffer. This writes past the allocated chunk, overwriting adjacent heap metadata, other objects, and essentially nuking the process memory.

While this is an absolute slam-dunk for Denial of Service, achieving Remote Code Execution (RCE) is tricky. On 64-bit Windows, the heap is randomized, and the sheer volume of data being written (2GB) makes it hard to stop writing exactly where you want to execute code. You're more likely to hit an unmapped page and segfault before you can overwrite a function pointer nicely.

The Impact: Why should we care?

You might be thinking, "Who sends 2GB of data to a command line?" In the world of modern computing, the answer is "automated systems handling big data" or "fuzzers."

Denial of Service (DoS) is the guaranteed outcome. For a desktop app, this is an annoyance. For a server-side component processing user uploads or IPC messages, this is a service outage. If a critical system daemon uses GLib to spawn helpers, an attacker can crash the daemon repeatedly.

Code Execution Risk: While I downplayed RCE earlier, do not underestimate the creativity of exploit devs. If the overflow can be manipulated to result in a len that is just slightly smaller than the actual data, and the attacker can control the heap layout (Heap Feng Shui), it might be possible to overwrite a critical structure immediately following the buffer without triggering a page fault. It is a high-difficulty, high-reward scenario.

The Fix: Upgrade or Filter

The remediation is straightforward: Update GLib. Version 2.84.1 contains the fix. If you are a developer bundling GLib (e.g., using vcpkg, MSYS2, or vending the DLLs with your app), you must rebuild or redistribute the new version.

If you cannot update immediately, you must sanitize your inputs. Ensure that no code path allows user-controlled input to result in a command-line argument list approaching 2GB. Frankly, if your application design requires passing 2GB of data via command-line arguments, you should probably rethink your architecture and use pipes or temporary files instead.

> [!NOTE] > This vulnerability is specific to Windows because the Unix implementation uses execve with an array of pointers, avoiding this specific string concatenation/length calculation logic.

Official Patches

GNOMEOfficial fix commit in GLib repository

Fix Analysis (1)

Technical Appendix

CVSS Score
7.5/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
EPSS Probability
0.09%
Top 75% most exploited

Affected Systems

Windows Applications using GLibGNOME on WindowsCross-platform tools ported to Windows via MSYS2/MinGW

Affected Versions Detail

Product
Affected Versions
Fixed Version
GLib
GNOME
< 2.84.12.84.1
AttributeDetail
CWE IDCWE-190 (Integer Overflow)
Secondary CWECWE-122 (Heap-based Buffer Overflow)
Attack VectorNetwork / Local (Input Dependent)
CVSS v3.17.5 (High)
ImpactDoS, Potential RCE
PlatformWindows (Exclusive)

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1499Endpoint Denial of Service
Impact
CWE-190
Integer Overflow or Wraparound

The software performs a calculation that can produce an integer overflow or wraparound, when the logic assumes that the resulting value will always be larger than the original value. This can be used to bypass security checks or allocate insufficient memory.

Known Exploits & Detection

Research AnalysisTheoretical exploitability demonstrated via code analysis of gspawn-win32.c

Vulnerability Timeline

Vulnerability Reported
2025-04-29
Patch Released (GLib 2.84.1)
2025-07-28
NVD Analysis Complete
2026-01-08

References & Sources

  • [1]NVD - CVE-2025-4056
  • [2]GLib GitLab Repository
  • [3]Red Hat Bugzilla #2362826

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•2 days ago•CVE-2026-9354
6.9

CVE-2026-9354: Arbitrary Mass Mention Bypass in NousResearch hermes-agent Slack and Mattermost Adapters

A vulnerability in the Slack and Mattermost platform adapters for NousResearch hermes-agent permits an unauthenticated remote attacker to execute arbitrary mass mentions. By leveraging prompt injection, an attacker can bypass output sanitization logic and trigger workspace-wide notification exhaustion.

Alon Barad
Alon Barad
24 views•6 min read
•3 days ago•CVE-2026-9306
6.3

CVE-2026-9306: Unauthenticated Insecure Direct Object Reference (IDOR) in QuantumNous new-api Midjourney Relay

CVE-2026-9306 is a critical unauthenticated Insecure Direct Object Reference (IDOR) vulnerability located in the QuantumNous new-api application, affecting versions up to and including 0.12.1. The flaw is caused by improper middleware ordering combined with a lack of object-level authorization checks. This allows remote, unauthenticated attackers to retrieve sensitive Midjourney images belonging to other users by supplying a valid task identifier.

Amit Schendel
Amit Schendel
10 views•5 min read
•3 days ago•GHSA-GGXF-37HM-9WQF
6.5

GHSA-GGXF-37HM-9WQF: Session Leakage via Unsafe Challenge Path Parsing in instagrapi

The instagrapi library prior to version 2.6.9 contains an improper input validation vulnerability within its challenge handling mechanism. Maliciously crafted server responses can manipulate the client into forwarding session cookies and credentials to an external attacker-controlled domain.

Amit Schendel
Amit Schendel
20 views•6 min read
•4 days ago•GHSA-QQQM-5547-774X
9.1

GHSA-QQQM-5547-774X: Unauthenticated Path Traversal in FileBrowser Quantum PATCH Handler

GHSA-QQQM-5547-774X is a critical path traversal vulnerability in the FileBrowser Quantum application, specifically within the Go backend package. The vulnerability resides in the HTTP handler responsible for processing bulk file modifications via the public API. Unauthenticated attackers can exploit an order-of-operations flaw in the path sanitization logic to bypass intended directory restrictions. This allows adversaries to arbitrarily read, move, and overwrite files on the underlying filesystem by supplying specially crafted HTTP PATCH requests.

Alon Barad
Alon Barad
5 views•6 min read
•4 days ago•CVE-2026-8723
5.3

CVE-2026-8723: Synchronous Denial of Service in qs npm Package via TypeError

The qs query string parsing and serialization library for Node.js is vulnerable to a synchronous Denial of Service (DoS) attack. The vulnerability manifests as a process-terminating TypeError when processing arrays with null or undefined elements under specific configuration parameters.

Amit Schendel
Amit Schendel
33 views•7 min read
•4 days ago•GHSA-7M8F-HGJQ-8GC9
7.5

GHSA-7M8F-HGJQ-8GC9: Pre-Authentication Denial of Service via Insecure Deserialization Order in aiosend

The aiosend library prior to version 3.0.6 contains a pre-authentication Denial of Service (DoS) vulnerability in its webhook handling mechanism. The software processes and deserializes incoming JSON payloads before verifying the cryptographic signature, allowing unauthenticated attackers to exhaust server CPU and memory resources by sending large, complex payloads.

Amit Schendel
Amit Schendel
3 views•6 min read