
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-40611 is a path traversal vulnerability in the webroot HTTP-01 challenge provider of Lego, a Let's Encrypt client and ACME library written in Go. 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, or delete arbitrary files. All versions prior to 4.34.0 are affected. The vulnerability was published on April 21, 2026, and carries a CVSS v3.1 base score of 8.8 (High) (GitHub Advisory).
The root cause is improper input validation (CWE-22) in the ChallengePath() function in challenge/http01/http_challenge.go, which directly concatenates the ACME token to the challenge path without sanitizing it: return "/.well-known/acme-challenge/" + token. The webroot provider in providers/http/webroot/webroot.go then joins this with the configured webroot directory using filepath.Join() and writes content to the resulting path. Because RFC 8555 Section 8.3 restricts ACME tokens to base64url characters ([A-Za-z0-9_-]) but Lego never enforces this constraint, a malicious server can return a token like ../../../../../../tmp/evil, causing filepath.Join() to resolve outside the webroot. The same unsanitized path is used in the CleanUp() function via os.Remove(), enabling arbitrary file deletion in addition to arbitrary file write (GitHub Advisory).
Successful exploitation allows a malicious ACME server to write attacker-controlled content to any filesystem path writable by the Lego process, or delete arbitrary files via the cleanup code path. Depending on the privileges under which Lego runs, an attacker could achieve remote code execution by writing to cron directories, systemd unit paths, shell profiles, or web application directories; destroy data by overwriting configuration files, TLS certificates, or application state; and if Lego runs as root, gain unrestricted filesystem write access across the entire system (GitHub Advisory).
A proof-of-concept is publicly available in the GitHub Security Advisory, demonstrating the vulnerability both via a minimal Go program calling the webroot provider directly and via a real-world attack scenario using --server to point Lego at a malicious ACME server. Exploitation requires user interaction in the sense that the victim must run Lego against a malicious or compromised ACME server. There is no evidence of in-the-wild exploitation at this time, and the CVE is not listed in the CISA KEV catalog. The EPSS score is 0.046% (GitHub Advisory).
../../../../../../tmp/pwned.--server pointing to the malicious ACME server, or performs a network-level redirect (e.g., DNS hijacking, BGP hijacking) to route Lego's ACME requests to the attacker-controlled server.lego --server https://malicious-acme.example.com --http --http.webroot /var/www/html --email user@example.com --domains example.com run, initiating the certificate issuance flow.../../../../../../etc/cron.d/backdoor).filepath.Join(w.path, http01.ChallengePath(token)), resolves the traversal, and writes the key authorization content (attacker-influenced) to the target path outside the webroot.CleanUp() function calls os.Remove() on the same unsanitized path, deleting the targeted file./etc/cron.d/, /etc/systemd/system/, ~/.bashrc, ~/.profile, or web application directories; unexpected deletion of configuration files, TLS certificates, or application state files.Upgrade Lego to version 4.34.0 or later, which fixes the vulnerability by validating ACME tokens against the RFC 8555-specified base64url character set before constructing file paths. As a temporary workaround until patching is complete, restrict network access so that Lego can only communicate with trusted, known-good ACME servers (e.g., Let's Encrypt production/staging), and ensure the Lego process runs with the minimum required filesystem permissions to limit the blast radius of any path traversal exploitation (GitHub Advisory).
The vulnerability was reported by security researcher RealHurrison and published by Lego maintainer ldez via a GitHub Security Advisory on April 15, 2026. A Tenable Nessus plugin (ID 309695) was released to detect vulnerable Lego installations. The advisory was noted on Mastodon by @thehackerwire and indexed by multiple vulnerability tracking services shortly after publication (GitHub Advisory, Tenable).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."