# CVE-2026-40611: Lego: Arbitrary File Write via Path Traversal in Webroot HTTP-01 Provider

> A malicious ACME server can exploit path traversal in the webroot provider to write arbitrary files, potentially leading to code execution.

- **Severity:** High 8.8 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`)
- **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:** 21 Apr 2026
- **Updated:** 15 Jul 2026
- **Also known as:** CLEANSTART-2026-KT84205, DEBIAN-CVE-2026-40611, GHSA-qqx8-2xmm-jrv8, GO-2026-5593, MINI-6p9x-gxj9-fq33, MINI-6w5j-2j73-xmf2, MINI-7r25-xqq8-xgqp, UBUNTU-CVE-2026-40611

## What is CVE-2026-40611?

CVE-2026-40611 is a high-severity path traversal vulnerability in go-acme lego, published on 21 Apr 2026. 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

Let's Encrypt client and ACME library written in Go (Lego). Prior to 4.34.0, the webroot HTTP-01 challenge provider in lego is vulnerable to arbitrary file write and deletion via path traversal. A malicious ACME server can supply a crafted challenge token containing ../ sequences, causing lego to write attacker-influenced content to any path writable by the lego process. This vulnerability is fixed in 4.34.0.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

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

7 open source packages ship an affected version, including github.com/go-acme/lego/v4, github.com/go-acme/lego and github.com/go-acme/lego/v3.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/go-acme/lego/v4` | Go | All versions | 4.34.0 |
| `github.com/go-acme/lego/v4` | Go | All versions | 4.34.0 |
| `github.com/go-acme/lego/v4` | Go | All versions | 4.34.0 |
| `github.com/go-acme/lego` | Go | All versions to 2.7.2 | None |
| `github.com/go-acme/lego` | Go | All versions to 2.7.2 | None |
| `github.com/go-acme/lego/v3` | Go | All versions to 3.9.0 | None |
| `github.com/go-acme/lego/v3` | Go | All versions to 3.9.0 | None |

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

Upgrade github.com/go-acme/lego/v4 to 4.34.0 or later.

## Is CVE-2026-40611 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-40611 exists.

## Fix prompt for AI coding agents

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

What it is: CVE-2026-40611 is a high-severity path traversal vulnerability in go-acme lego, published on 21 Apr 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-40611 exists.

Affected packages and fixed versions:
- github.com/go-acme/lego/v4 (Go): affected all versions; fixed in 4.34.0
- github.com/go-acme/lego/v4 (Go): affected all versions; fixed in 4.34.0
- github.com/go-acme/lego/v4 (Go): affected all versions; fixed in 4.34.0
- github.com/go-acme/lego (Go): affected all versions up to 2.7.2; no fix listed
- github.com/go-acme/lego (Go): affected all versions up to 2.7.2; no fix listed
- github.com/go-acme/lego/v3 (Go): affected all versions up to 3.9.0; no fix listed
- github.com/go-acme/lego/v3 (Go): affected all versions up to 3.9.0; no fix listed

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

## Sources

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

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