# CVE-2025-6052: Glib: integer overflow in g_string_maybe_expand() leading to potential buffer overflow in glib gstring

> An integer overflow in GLib's GString memory management can lead to buffer overflows, causing crashes or potential code execution.

- **Severity:** Low 3.7 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 13 Jun 2025
- **Updated:** 2 Jun 2026
- **Also known as:** AZL-63912, BELL-CVE-2025-6052, BIT-java-2025-6052, BIT-java-min-2025-6052, BIT-jre-2025-6052, DEBIAN-CVE-2025-6052, ECHO-b543-f20a-a5c6, GHSA-99rj-3595-5frj, JLSEC-2025-167, MGASA-2025-0216, MINI-g7h7-p9gf-cf9w, MINI-p83j-9wj6-vxcj, OESA-2025-1795, OESA-2025-1796, OESA-2025-1797, SUSE-SU-2025:20673-1, UBUNTU-CVE-2025-6052, openSUSE-SU-2025:15221-1

## What is CVE-2025-6052?

CVE-2025-6052 is a low-severity vulnerability in Red Hat Enterprise Linux 10, published on 13 Jun 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

A flaw was found in how GLib’s GString manages memory when adding data to strings. If a string is already very large, combining it with more input can cause a hidden overflow in the size calculation. This makes the system think it has enough memory when it doesn’t. As a result, data may be written past the end of the allocated memory, leading to crashes or memory corruption.

Weakness: CWE-190 (Integer Overflow or Wraparound)

## Which versions are affected by CVE-2025-6052?

3 open source packages ship an affected version, including java, java-min and jre. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `java` | Bitnami | All versions | 1.8.0, 8.0.481 |
| `java-min` | Bitnami | All versions | 1.8.0, 8.0.481 |
| `jre` | Bitnami | All versions | 1.8.0, 8.0.481 |
| `glib2` | SUSE:Linux Micro 6.1 | All versions | 2.78.6-slfo.1.1_4.1 |
| `glib2` | openSUSE:Tumbleweed | All versions | 2.84.3-1.1 |

Products: Gnome Glib.

## How do I fix CVE-2025-6052?

Upgrade java to a fixed version for your release line: 1.8.0 or 8.0.481.

## Is CVE-2025-6052 being exploited?

There is no known exploitation of CVE-2025-6052 in the wild and no public exploit code.

## Other vulnerabilities in Red Hat Enterprise Linux 10

- [CVE-2020-35457](https://insights.sbomify.com/CVE-2020-35457/): Integer overflow in n/a (high 7.8)
- [CVE-2009-3289](https://insights.sbomify.com/CVE-2009-3289/): Privilege escalation in n/a (high 7.8)
- [CVE-2025-13601](https://insights.sbomify.com/CVE-2025-13601/): Glib: integer overflow in in g_escape_uri_string() (high 7.7)
- [CVE-2026-58016](https://insights.sbomify.com/CVE-2026-58016/): Glib: integer underflow in gio/gdbusintrospection.c via "g_dbus_node_info_new_for_xml" (high 7.5)
- [CVE-2025-4056](https://insights.sbomify.com/CVE-2025-4056/): Glib: glib crash after long command line (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-6052 and fix it if it is affected.

What it is: CVE-2025-6052 is a low-severity vulnerability in Red Hat Enterprise Linux 10, published on 13 Jun 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2025-6052 in the wild and no public exploit code.

Affected packages and fixed versions:
- java (Bitnami): affected all versions; fixed in 1.8.0, 8.0.481
- java-min (Bitnami): affected all versions; fixed in 1.8.0, 8.0.481
- jre (Bitnami): affected all versions; fixed in 1.8.0, 8.0.481

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-6052/ (Markdown: https://insights.sbomify.com/CVE-2025-6052/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-6052
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-6052
- OSV: https://osv.dev/vulnerability/CVE-2025-6052

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-6052/
Summaries are generated and may contain mistakes; the official description above is the record.
