# CVE-2007-3387: Integer overflow in n/a

> Remote attackers can execute arbitrary code via crafted PDF files due to an integer overflow in xpdf and related libraries.

- **Severity:** Medium 6.8 (`AV:N/AC:M/Au:N/C:P/I:P/A:P`)
- **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:** 30 Jul 2007
- **Updated:** 7 Aug 2024
- **Also known as:** CVE-2007-5049, DEBIAN-CVE-2007-3387, DSA-1347-1, DSA-1348-1, DSA-1349-1, DSA-1350-1, DSA-1352-1, DSA-1354-1, DSA-1355-1, DSA-1357-1, DTSA-49-1, DTSA-50-1, DTSA-54-1, DTSA-62-1, GHSA-v25x-frpw-qg4x, RHSA-2007:0720, RHSA-2007:0729, RHSA-2007:0730, RHSA-2007:0731, RHSA-2007:0732, RHSA-2007:0735

## What is CVE-2007-3387?

CVE-2007-3387 is a medium-severity vulnerability in Apple Cups, published on 30 Jul 2007. 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

Integer overflow in the StreamPredictor::StreamPredictor function in xpdf 3.02, as used in (1) poppler before 0.5.91, (2) gpdf before 2.8.2, (3) kpdf, (4) kdegraphics, (5) CUPS, (6) PDFedit, and other products, might allow remote attackers to execute arbitrary code via a crafted PDF file that triggers a stack-based buffer overflow in the StreamPredictor::getNextLine function.

Weakness: CWE-190 (Integer Overflow or Wraparound)

## Which versions are affected by CVE-2007-3387?

It affects 6 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `tetex` | Red Hat:enterprise_linux:2.1::as | All versions | 0:1.0.7-38.5E.11 |
| `tetex-afm` | Red Hat:enterprise_linux:2.1::as | All versions | 0:1.0.7-38.5E.11 |
| `tetex-doc` | Red Hat:enterprise_linux:2.1::as | All versions | 0:1.0.7-38.5E.11 |
| `tetex-dvilj` | Red Hat:enterprise_linux:2.1::as | All versions | 0:1.0.7-38.5E.11 |
| `tetex-dvips` | Red Hat:enterprise_linux:2.1::as | All versions | 0:1.0.7-38.5E.11 |
| `tetex-fonts` | Red Hat:enterprise_linux:2.1::as | All versions | 0:1.0.7-38.5E.11 |
| `tetex-latex` | Red Hat:enterprise_linux:2.1::as | All versions | 0:1.0.7-38.5E.11 |
| `tetex-xdvi` | Red Hat:enterprise_linux:2.1::as | All versions | 0:1.0.7-38.5E.11 |
| `xpdf` | Red Hat:enterprise_linux:2.1::as | All versions | 1:0.92-18.RHEL2 |
| `tetex` | Red Hat:enterprise_linux:2.1::aw | All versions | 0:1.0.7-38.5E.11 |
| `tetex-afm` | Red Hat:enterprise_linux:2.1::aw | All versions | 0:1.0.7-38.5E.11 |
| `tetex-doc` | Red Hat:enterprise_linux:2.1::aw | All versions | 0:1.0.7-38.5E.11 |
| `tetex-dvilj` | Red Hat:enterprise_linux:2.1::aw | All versions | 0:1.0.7-38.5E.11 |
| `tetex-dvips` | Red Hat:enterprise_linux:2.1::aw | All versions | 0:1.0.7-38.5E.11 |
| `tetex-fonts` | Red Hat:enterprise_linux:2.1::aw | All versions | 0:1.0.7-38.5E.11 |
| `tetex-latex` | Red Hat:enterprise_linux:2.1::aw | All versions | 0:1.0.7-38.5E.11 |
| `tetex-xdvi` | Red Hat:enterprise_linux:2.1::aw | All versions | 0:1.0.7-38.5E.11 |
| `xpdf` | Red Hat:enterprise_linux:2.1::aw | All versions | 1:0.92-18.RHEL2 |
| `tetex` | Red Hat:enterprise_linux:2.1::es | All versions | 0:1.0.7-38.5E.11 |
| `tetex-afm` | Red Hat:enterprise_linux:2.1::es | All versions | 0:1.0.7-38.5E.11 |
| `tetex-doc` | Red Hat:enterprise_linux:2.1::es | All versions | 0:1.0.7-38.5E.11 |
| `tetex-dvilj` | Red Hat:enterprise_linux:2.1::es | All versions | 0:1.0.7-38.5E.11 |
| `tetex-dvips` | Red Hat:enterprise_linux:2.1::es | All versions | 0:1.0.7-38.5E.11 |
| `tetex-fonts` | Red Hat:enterprise_linux:2.1::es | All versions | 0:1.0.7-38.5E.11 |
| `tetex-latex` | Red Hat:enterprise_linux:2.1::es | All versions | 0:1.0.7-38.5E.11 |
| `tetex-xdvi` | Red Hat:enterprise_linux:2.1::es | All versions | 0:1.0.7-38.5E.11 |
| `xpdf` | Red Hat:enterprise_linux:2.1::es | All versions | 1:0.92-18.RHEL2 |
| `tetex` | Red Hat:enterprise_linux:2.1::ws | All versions | 0:1.0.7-38.5E.11 |
| `tetex-afm` | Red Hat:enterprise_linux:2.1::ws | All versions | 0:1.0.7-38.5E.11 |
| `tetex-doc` | Red Hat:enterprise_linux:2.1::ws | All versions | 0:1.0.7-38.5E.11 |
| `tetex-dvilj` | Red Hat:enterprise_linux:2.1::ws | All versions | 0:1.0.7-38.5E.11 |
| `tetex-dvips` | Red Hat:enterprise_linux:2.1::ws | All versions | 0:1.0.7-38.5E.11 |
| `tetex-fonts` | Red Hat:enterprise_linux:2.1::ws | All versions | 0:1.0.7-38.5E.11 |
| `tetex-latex` | Red Hat:enterprise_linux:2.1::ws | All versions | 0:1.0.7-38.5E.11 |
| `tetex-xdvi` | Red Hat:enterprise_linux:2.1::ws | All versions | 0:1.0.7-38.5E.11 |
| `xpdf` | Red Hat:enterprise_linux:2.1::ws | All versions | 1:0.92-18.RHEL2 |
| `cups` | Red Hat:enterprise_linux:3::as | All versions | 1:1.1.17-13.3.45 |
| `cups-debuginfo` | Red Hat:enterprise_linux:3::as | All versions | 1:1.1.17-13.3.45 |
| `cups-devel` | Red Hat:enterprise_linux:3::as | All versions | 1:1.1.17-13.3.45 |
| `cups-libs` | Red Hat:enterprise_linux:3::as | All versions | 1:1.1.17-13.3.45 |

Products: Apple Cups, Canonical Ubuntu Linux, Debian Debian Linux, Freedesktop Poppler, Gpdf Project Gpdf, Xpdfreader Xpdf.

## How do I fix CVE-2007-3387?

Upgrade to a fixed version.

## Is CVE-2007-3387 being exploited?

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

## Other vulnerabilities in Apple Cups

- [CVE-2008-5184](https://insights.sbomify.com/CVE-2008-5184/): Cross-site request forgery in n/a (critical 10.0)
- [CVE-2008-3641](https://insights.sbomify.com/CVE-2008-3641/): Memory corruption in n/a (critical 10.0)
- [CVE-2008-0053](https://insights.sbomify.com/CVE-2008-0053/): Memory corruption in n/a (critical 10.0)
- [CVE-2012-6094](https://insights.sbomify.com/CVE-2012-6094/): Missing authorization in cups (critical 9.8)
- [CVE-2010-2941](https://insights.sbomify.com/CVE-2010-2941/): Use after free in n/a (critical 9.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2007-3387 and fix it if it is affected.

What it is: CVE-2007-3387 is a medium-severity vulnerability in Apple Cups, published on 30 Jul 2007. 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-2007-3387 in the wild and no public exploit code.

Affected product: Apple Cups. 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-2007-3387/ (Markdown: https://insights.sbomify.com/CVE-2007-3387/index.md)
```

## Sources

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

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