# CVE-2025-6297: dpkg-deb: Fix cleanup for control member with restricted directories

> Attackers can cause disk exhaustion and denial of service by exploiting improper cleanup of temporary files during dpkg-deb extraction of malicious packages.

- **Severity:** High 8.2 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 1 Jul 2025
- **Updated:** 8 Jul 2026
- **Also known as:** AZL-64641, CLSA-2025-1760024944, CLSA-2025-1764321086, DEBIAN-CVE-2025-6297, ECHO-9dc0-d8d0-3783, GHSA-w56q-6jw5-h5xf, MGASA-2025-0204, SUSE-SU-2025:02734-1, SUSE-SU-2025:20562-1, SUSE-SU-2025:20670-1, UBUNTU-CVE-2025-6297, USN-7768-1, openSUSE-SU-2025:15314-1

## What is CVE-2025-6297?

CVE-2025-6297 is a high-severity denial of service vulnerability in Debian dpkg, published on 1 Jul 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

It was discovered that dpkg-deb does not properly sanitize directory permissions when extracting a control member into a temporary directory, which is
documented as being a safe operation even on untrusted data. This may result in leaving temporary files behind on cleanup. Given automated and repeated execution of dpkg-deb commands on
adversarial .deb packages or with well compressible files, placed
inside a directory with permissions not allowing removal by a non-root
user, this can end up in a DoS scenario due to causing disk quota
exhaustion or disk full conditions.

Weakness: CWE-732 (Incorrect Permission Assignment for Critical Resource), CWE-400 (Uncontrolled Resource Consumption)

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

It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `update-alternatives` | SUSE:Linux Enterprise Micro 5.1 | All versions | 1.19.0.4-150000.4.7.1 |
| `update-alternatives` | SUSE:Linux Enterprise Micro 5.2 | All versions | 1.19.0.4-150000.4.7.1 |
| `update-alternatives` | SUSE:Linux Enterprise Micro 5.3 | All versions | 1.19.0.4-150000.4.7.1 |
| `update-alternatives` | SUSE:Linux Enterprise Micro 5.4 | All versions | 1.19.0.4-150000.4.7.1 |
| `update-alternatives` | SUSE:Linux Enterprise Micro 5.5 | All versions | 1.19.0.4-150000.4.7.1 |
| `update-alternatives` | SUSE:Linux Enterprise Module for Basesystem 15 SP6 | All versions | 1.19.0.4-150000.4.7.1 |
| `update-alternatives` | SUSE:Linux Enterprise Module for Basesystem 15 SP7 | All versions | 1.19.0.4-150000.4.7.1 |
| `dpkg` | SUSE:Linux Enterprise Module for Development Tools 15 SP6 | All versions | 1.19.0.4-150000.4.7.1 |
| `dpkg` | SUSE:Linux Enterprise Module for Development Tools 15 SP7 | All versions | 1.19.0.4-150000.4.7.1 |
| `update-alternatives` | SUSE:Linux Micro 6.0 | All versions | 1.22.0-2.1 |
| `update-alternatives` | SUSE:Linux Micro 6.1 | All versions | 1.22.0-slfo.1.1_2.1 |
| `dpkg` | openSUSE:Leap 15.6 | All versions | 1.19.0.4-150000.4.7.1 |
| `update-alternatives` | openSUSE:Leap 15.6 | All versions | 1.19.0.4-150000.4.7.1 |
| `dpkg` | openSUSE:Tumbleweed | All versions | 1.22.21-1.1 |

Products: Debian Dpkg.

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

Apply the vendor's patch.

## Is CVE-2025-6297 being exploited?

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

## Other vulnerabilities in Debian dpkg

- [CVE-2017-8283](https://insights.sbomify.com/CVE-2017-8283/): Path traversal in n/a (critical 9.8)
- [CVE-2026-2219](https://insights.sbomify.com/CVE-2026-2219/): Denial of service in dpkg (high 7.5)
- [CVE-2004-2768](https://insights.sbomify.com/CVE-2004-2768/): Privilege escalation in n/a (high 7.2)
- [CVE-2014-3127](https://insights.sbomify.com/CVE-2014-3127/): Path traversal in n/a (high 7.1)
- [CVE-2014-8625](https://insights.sbomify.com/CVE-2014-8625/): Memory corruption in n/a (medium 6.8)

## Fix prompt for AI coding agents

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

What it is: CVE-2025-6297 is a high-severity denial of service vulnerability in Debian dpkg, published on 1 Jul 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-6297 in the wild and no public exploit code.

Affected product: Debian dpkg. 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-2025-6297/ (Markdown: https://insights.sbomify.com/CVE-2025-6297/index.md)
```

## Sources

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

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