# CVE-2012-0039: Denial of service in n/a

> Attackers can cause CPU exhaustion in applications using GLib's g_str_hash function by triggering predictable hash collisions with crafted input.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 14 Jan 2012
- **Updated:** 21 Jan 2025
- **Also known as:** DEBIAN-CVE-2012-0039, GHSA-7w5v-h2pc-qqwc, UBUNTU-CVE-2012-0039

## What is CVE-2012-0039?

CVE-2012-0039 is a high-severity denial of service vulnerability in n/a, published on 14 Jan 2012. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

GLib 2.31.8 and earlier, when the g_str_hash function is used, computes hash values without restricting the ability to trigger hash collisions predictably, which allows context-dependent attackers to cause a denial of service (CPU consumption) via crafted input to an application that maintains a hash table. NOTE: this issue may be disputed by the vendor; the existence of the g_str_hash function is not a vulnerability in the library, because callers of g_hash_table_new and g_hash_table_new_full can specify an arbitrary hash function that is appropriate for the application.

Weakness: CWE-310

## Which versions are affected by CVE-2012-0039?

It affects 1 product.


Products: Gnome Glib.

## How do I fix CVE-2012-0039?

No fix has been published for CVE-2012-0039 yet. Limit exposure of the affected software until one is available.

## Is CVE-2012-0039 being exploited?

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

## Other vulnerabilities in n/a

- [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-2012-0039 and fix it if it is affected.

What it is: CVE-2012-0039 is a high-severity denial of service vulnerability in n/a, published on 14 Jan 2012. 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-2012-0039 in the wild and no public exploit code.

Affected product: n/a. No package-level version data is available, so check the vendor advisory linked from the reference page.

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-2012-0039/ (Markdown: https://insights.sbomify.com/CVE-2012-0039/index.md)
```

## Sources

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

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