# CVE-2011-2895: Memory corruption in n/a

> A heap-based buffer overflow in the LZW decompressor allows attackers to execute arbitrary code or cause denial of service via crafted compressed streams.

- **Severity:** Critical 9.3 (`AV:N/AC:M/Au:N/C:C/I:C/A:C`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 19 Aug 2011
- **Updated:** 6 Aug 2024
- **Also known as:** DEBIAN-CVE-2011-2895, DSA-2293-1, GHSA-8hvp-h85w-jwq9, RHSA-2011:1154, RHSA-2011:1155, RHSA-2011:1161, RHSA-2011:1834, openSUSE-SU-2024:10169-1

## What is CVE-2011-2895?

CVE-2011-2895 is a critical memory corruption vulnerability in Freebsd Freebsd, published on 19 Aug 2011. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

The LZW decompressor in (1) the BufCompressedFill function in fontfile/decompress.c in X.Org libXfont before 1.4.4 and (2) compress/compress.c in 4.3BSD, as used in zopen.c in OpenBSD before 3.8, FreeBSD, NetBSD 4.0.x and 5.0.x before 5.0.3 and 5.1.x before 5.1.1, FreeType 2.1.9, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows context-dependent attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2896.

Weakness: CWE-119 (Improper Restriction of Operations within the Bounds of a Memory Buffer)

## Which versions are affected by CVE-2011-2895?

It affects 5 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `freetype` | Red Hat:enterprise_linux:4::as | All versions | 0:2.1.9-19.el4 |
| `freetype-debuginfo` | Red Hat:enterprise_linux:4::as | All versions | 0:2.1.9-19.el4 |
| `freetype-demos` | Red Hat:enterprise_linux:4::as | All versions | 0:2.1.9-19.el4 |
| `freetype-devel` | Red Hat:enterprise_linux:4::as | All versions | 0:2.1.9-19.el4 |
| `freetype-utils` | Red Hat:enterprise_linux:4::as | All versions | 0:2.1.9-19.el4 |
| `xorg-x11` | Red Hat:enterprise_linux:4::as | All versions | 0:6.8.2-1.EL.69 |
| `xorg-x11-Mesa-libGL` | Red Hat:enterprise_linux:4::as | All versions | 0:6.8.2-1.EL.69 |
| `xorg-x11-Mesa-libGLU` | Red Hat:enterprise_linux:4::as | All versions | 0:6.8.2-1.EL.69 |
| `xorg-x11-Xdmx` | Red Hat:enterprise_linux:4::as | All versions | 0:6.8.2-1.EL.69 |
| `xorg-x11-Xnest` | Red Hat:enterprise_linux:4::as | All versions | 0:6.8.2-1.EL.69 |
| `xorg-x11-Xvfb` | Red Hat:enterprise_linux:4::as | All versions | 0:6.8.2-1.EL.69 |
| `xorg-x11-deprecated-libs` | Red Hat:enterprise_linux:4::as | All versions | 0:6.8.2-1.EL.69 |
| `xorg-x11-deprecated-libs-devel` | Red Hat:enterprise_linux:4::as | All versions | 0:6.8.2-1.EL.69 |
| `xorg-x11-devel` | Red Hat:enterprise_linux:4::as | All versions | 0:6.8.2-1.EL.69 |
| `xorg-x11-doc` | Red Hat:enterprise_linux:4::as | All versions | 0:6.8.2-1.EL.69 |
| `xorg-x11-font-utils` | Red Hat:enterprise_linux:4::as | All versions | 0:6.8.2-1.EL.69 |
| `xorg-x11-libs` | Red Hat:enterprise_linux:4::as | All versions | 0:6.8.2-1.EL.69 |
| `xorg-x11-sdk` | Red Hat:enterprise_linux:4::as | All versions | 0:6.8.2-1.EL.69 |
| `xorg-x11-tools` | Red Hat:enterprise_linux:4::as | All versions | 0:6.8.2-1.EL.69 |
| `xorg-x11-twm` | Red Hat:enterprise_linux:4::as | All versions | 0:6.8.2-1.EL.69 |
| `xorg-x11-xauth` | Red Hat:enterprise_linux:4::as | All versions | 0:6.8.2-1.EL.69 |
| `xorg-x11-xdm` | Red Hat:enterprise_linux:4::as | All versions | 0:6.8.2-1.EL.69 |
| `xorg-x11-xfs` | Red Hat:enterprise_linux:4::as | All versions | 0:6.8.2-1.EL.69 |
| `freetype` | Red Hat:enterprise_linux:4::desktop | All versions | 0:2.1.9-19.el4 |
| `freetype-debuginfo` | Red Hat:enterprise_linux:4::desktop | All versions | 0:2.1.9-19.el4 |
| `freetype-demos` | Red Hat:enterprise_linux:4::desktop | All versions | 0:2.1.9-19.el4 |
| `freetype-devel` | Red Hat:enterprise_linux:4::desktop | All versions | 0:2.1.9-19.el4 |
| `freetype-utils` | Red Hat:enterprise_linux:4::desktop | All versions | 0:2.1.9-19.el4 |
| `xorg-x11` | Red Hat:enterprise_linux:4::desktop | All versions | 0:6.8.2-1.EL.69 |
| `xorg-x11-Mesa-libGL` | Red Hat:enterprise_linux:4::desktop | All versions | 0:6.8.2-1.EL.69 |
| `xorg-x11-Mesa-libGLU` | Red Hat:enterprise_linux:4::desktop | All versions | 0:6.8.2-1.EL.69 |
| `xorg-x11-Xdmx` | Red Hat:enterprise_linux:4::desktop | All versions | 0:6.8.2-1.EL.69 |
| `xorg-x11-Xnest` | Red Hat:enterprise_linux:4::desktop | All versions | 0:6.8.2-1.EL.69 |
| `xorg-x11-Xvfb` | Red Hat:enterprise_linux:4::desktop | All versions | 0:6.8.2-1.EL.69 |
| `xorg-x11-deprecated-libs` | Red Hat:enterprise_linux:4::desktop | All versions | 0:6.8.2-1.EL.69 |
| `xorg-x11-deprecated-libs-devel` | Red Hat:enterprise_linux:4::desktop | All versions | 0:6.8.2-1.EL.69 |
| `xorg-x11-devel` | Red Hat:enterprise_linux:4::desktop | All versions | 0:6.8.2-1.EL.69 |
| `xorg-x11-doc` | Red Hat:enterprise_linux:4::desktop | All versions | 0:6.8.2-1.EL.69 |
| `xorg-x11-font-utils` | Red Hat:enterprise_linux:4::desktop | All versions | 0:6.8.2-1.EL.69 |
| `xorg-x11-libs` | Red Hat:enterprise_linux:4::desktop | All versions | 0:6.8.2-1.EL.69 |

Products: Freebsd Freebsd, Freetype Freetype, Netbsd Netbsd, Openbsd Openbsd, X Libxfont.

## How do I fix CVE-2011-2895?

Upgrade to a fixed version.

## Is CVE-2011-2895 being exploited?

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

## Other vulnerabilities in Freebsd Freebsd

- [CVE-2018-17160](https://insights.sbomify.com/CVE-2018-17160/): Memory corruption in FreeBSD (critical 10.0)
- [CVE-2014-3954](https://insights.sbomify.com/CVE-2014-3954/): Memory corruption in n/a (critical 10.0)
- [CVE-2006-4304](https://insights.sbomify.com/CVE-2006-4304/): Memory corruption in n/a (critical 10.0)
- [CVE-2006-0226](https://insights.sbomify.com/CVE-2006-0226/): Integer overflow in n/a (critical 10.0)
- [CVE-2004-0002](https://insights.sbomify.com/CVE-2004-0002/): Denial of service in n/a (critical 10.0)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2011-2895 and fix it if it is affected.

What it is: CVE-2011-2895 is a critical memory corruption vulnerability in Freebsd Freebsd, published on 19 Aug 2011. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2011-2895 in the wild and no public exploit code.

Affected product: Freebsd Freebsd. 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-2011-2895/ (Markdown: https://insights.sbomify.com/CVE-2011-2895/index.md)
```

## Sources

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

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