# CVE-2026-40395: Denial of service in Varnish Enterprise

> Malicious clients can crash the Varnish Enterprise server via workspace overflow in shared VCL deployments, causing denial of service.

- **Severity:** Medium 4.0 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/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:** No
- **Published:** 12 Apr 2026
- **Updated:** 13 Apr 2026
- **Also known as:** GHSA-59jh-85v4-gxrf, UBUNTU-CVE-2026-40395

## What is CVE-2026-40395?

CVE-2026-40395 is a medium-severity denial of service vulnerability in varnish-software Varnish Enterprise, published on 12 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Varnish Enterprise before 6.0.16r12 allows a "workspace overflow" denial of service (daemon panic) for shared VCL. The headerplus.write_req0() function from vmod_headerplus updates the underlying req0, which is normally the original read-only request from which req is derived (readable and writable from VCL). This is useful in the active VCL, after amending req, to prepare a refined req0 before switching to a different VCL with the return (vcl(<label>)) action. This is for example how the Varnish Controller operates shared VCL deployments. If the amended req contained too many header fields for req0, this would have resulted in a workspace overflow that would in turn trigger a panic and crash the Varnish Enterprise server. This could be used as a Denial of Service attack vector by malicious clients.

Weakness: CWE-770 (Allocation of Resources Without Limits or Throttling)

## Which versions are affected by CVE-2026-40395?

It affects 1 product.


Products: Varnish-Software Varnish Enterprise.

## How do I fix CVE-2026-40395?

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

## Is CVE-2026-40395 being exploited?

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

## Other vulnerabilities in varnish-software Varnish Enterprise

- [CVE-2023-41104](https://insights.sbomify.com/CVE-2023-41104/): Memory corruption in n/a (medium 6.5)
- [CVE-2026-34475](https://insights.sbomify.com/CVE-2026-34475/): Varnish Cache before 8.0.1 and Varnish Enterprise before 6.0.16r12, in certain unchecked req.url scenarios, mishandle URLs with a path of / (medium 5.4)
- [CVE-2025-30346](https://insights.sbomify.com/CVE-2025-30346/): Other in Varnish Cache (medium 5.4)
- [CVE-2026-40394](https://insights.sbomify.com/CVE-2026-40394/): Denial of service in Varnish Cache (medium 4.0)
- [CVE-2025-30347](https://insights.sbomify.com/CVE-2025-30347/): Information disclosure in Varnish Enterprise (medium 4.0)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-40395 and fix it if it is affected.

What it is: CVE-2026-40395 is a medium-severity denial of service vulnerability in varnish-software Varnish Enterprise, published on 12 Apr 2026. 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-2026-40395 in the wild and no public exploit code.

Affected product: varnish-software Varnish Enterprise. 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-2026-40395/ (Markdown: https://insights.sbomify.com/CVE-2026-40395/index.md)
```

## Sources

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

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