Update module github.com/go-acme/lego/v4 to v4.34.0 [SECURITY]#72
Open
renovate[bot] wants to merge 1 commit into
Open
Update module github.com/go-acme/lego/v4 to v4.34.0 [SECURITY]#72renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
Contributor
Author
ℹ️ Artifact update noticeFile name: go.modIn order to perform the update(s) described in the table above, Renovate ran the
Details:
|
bc1315d to
b41283a
Compare
b41283a to
3af9d81
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
v4.31.0→v4.34.0ACME Lego: Arbitrary File Write via Path Traversal in Webroot HTTP-01 Provider
CVE-2026-40611 / GHSA-qqx8-2xmm-jrv8
More information
Details
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 inchallenge/http01/http_challenge.go:26-27constructs the challenge file path by directly concatenating the ACME token without any validation:The webroot provider in
providers/http/webroot/webroot.go:31then joins this with the configured webroot directory and writes the key authorization content to the resulting path: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 atproviders/http/webroot/webroot.go:48, which deletes the challenge file using the same unsanitized path:This additionally enables arbitrary file deletion.
PoC
In a real attack scenario, the victim uses
--serverto 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 user@example.com \ --domains example.com \ runThe 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:
go build -o exploit ./exploit.go && ./exploitExpected output:
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:
CleanUp()code path using the same unsanitized token.Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:HReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
go-acme/lego (github.com/go-acme/lego/v4)
v4.34.0Compare Source
Added
Changed
Fixed
v4.33.0Compare Source
Added
Changed
Fixed
v4.32.0Compare Source
Added
Changed
Fixed
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.