# CVE-2025-4056: GNOME GLib integer overflow in gspawn-win32.c

Source: https://junglewise.ai/threats/cve-2025-4056-gnome-glib-integer-overflow-in-gspawn-win32-c  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2025-07-28. Updated: 2026-06-25  
License: CC BY 4.0 with a link back

CVE-2025-4056 · Severity: high · CVSS 7.5 · Published 2025-07-28

GLib is a fundamental software library used by many applications on Windows to handle core system tasks. A flaw in how it processes long command lines can cause applications to crash unexpectedly. This could allow an attacker to disrupt services or cause software to fail by providing specially crafted, extremely long inputs to affected programs.

Technologies: [Gnome Glib](https://junglewise.ai/threats/technologies/glib), [Microsoft Windows](https://junglewise.ai/threats/technologies/windows). Vendors: [Gnome](https://junglewise.ai/threats/vendors/gnome), [Microsoft](https://junglewise.ai/threats/vendors/microsoft).

## Quick answers

**Is CVE-2025-4056 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2025-4056 being exploited in the wild.

**How severe is CVE-2025-4056?** High severity, with a CVSS score of 7.5, published 28 July 2025.

**Which products and versions are affected?** Gnome Glib < 2.84.1.

**Is there a fix for CVE-2025-4056?** A patch was published on 2025-04-01: Fix merged in version 2.84.1 Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2025-4056 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2025-4056?** Check whether you run Gnome Glib or Microsoft Windows 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

An integer overflow vulnerability exists in the `protect_argv_string` function within `gspawn-win32.c` in GLib. The function uses a signed integer (`gint`) to calculate the length of command line arguments; when an extremely long string is provided, this variable can overflow. This leads to either an undersized memory allocation resulting in a heap-based buffer overflow (segmentation fault) or a negative value being passed to `g_malloc`, triggering an intentional abort. The vulnerability is specific to Windows builds and can be triggered by any application using `g_spawn` functions with untrusted, long input strings. The issue is fixed in GLib version 2.84.1 by using `size_t` for length calculations and adding input validation.

## Affected products

- GNOME GLib < 2.84.1

## Timeline

- 2025-02-25: disclosed: Vulnerability reported via YesWeHack
- 2025-04-01: patched: Fix merged in version 2.84.1
- 2025-07-28: advisory: NVD publication date

## References

- [https://gitlab.gnome.org/GNOME/glib](https://gitlab.gnome.org/GNOME/glib)
- [https://access.redhat.com/downloads/content/package-browser/](https://access.redhat.com/downloads/content/package-browser/)
- [https://access.redhat.com/security/cve/CVE-2025-4056](https://access.redhat.com/security/cve/CVE-2025-4056)
- [https://bugzilla.redhat.com/show_bug.cgi?id=2362826](https://bugzilla.redhat.com/show_bug.cgi?id=2362826)
- [https://gitlab.gnome.org/GNOME/glib/-/issues/3668](https://gitlab.gnome.org/GNOME/glib/-/issues/3668)

## Related threats

- [Windows BitLocker heap buffer overflow with physical attack](https://junglewise.ai/threats/cve-2026-97015-heap-based-buffer-overflow-in-windows-bitlocker-allows-an)
- [Microsoft Windows Shell type confusion privilege elevation](https://junglewise.ai/threats/cve-2026-97013-access-of-resource-using-incompatible-type-type-confusion-in)
- [Microsoft Windows VMSwitch out-of-bounds read privilege escalation](https://junglewise.ai/threats/cve-2026-97002-out-of-bounds-read-in-windows-vmswitch-allows-an-authorized)
- [Microsoft Windows USM Communication Manager null pointer dereference](https://junglewise.ai/threats/cve-2026-97000-null-pointer-dereference-in-windows-usm-communication-manager)
- [Microsoft Windows Winsock use after free privilege escalation](https://junglewise.ai/threats/cve-2026-96994-use-after-free-in-winsock-allows-an-authorized-attacker-to)
