You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It was discovered that the github.com/go-acme/lego/v4/acme/api package (thus the lego library and the lego cli as well) don't enforce HTTPS when talking to CAs as an ACME client.
Details
Unlike the http-01 challenge which solves an ACME challenge over unencrypted HTTP, the ACME protocol requires HTTPS when a client communicates with the CA to performs ACME functions. This is stated in 6.1 of RFC 8555: https://datatracker.ietf.org/doc/html/rfc8555#section-6.1
Each ACME function is accomplished by the client sending a sequence
of HTTPS requests to the server [RFC2818], carrying JSON messages
[RFC8259]. Use of HTTPS is REQUIRED. Each subsection of Section 7
below describes the message formats used by the function and the
order in which messages are sent.
However, the library fails to enforce HTTPS both in the original discover URL (configured by the library user) and in the subsequent addresses returned by the CAs in the directory and order objects.
If the library user accidentally inputs an HTTP URL, or the CA similarly misconfigures its endpoints, this will cause the relevant parts of the protocol to be performed over HTTP. This can result, at the very least, in a lost of privacy of the request/response details, such as account and request identifiers (which could be intercepted by an attacker in a privileged network position). We did not investigate whether other more serious threats could result from the ability to impersonate a CA for some of the protocol requests, but enforcing HTTPS usage is definitely the safe choice.
Reproducing
This is illustrated in the attached http_acme_test.go. Since it uses private field Core.directory, this test must be placed inside the source directory of https://github.com/go-acme/lego/v4/acme/api to run.
Please note that this only checks getting the directory and creating a new account, but other ACME functions are likely impacted as well, such as creating orders, getting and checking order authorizations.
Details
package api
import (
"crypto/ecdsa""crypto/elliptic""crypto/rand""fmt""net/http""strings""testing""time""github.com/go-acme/lego/v4/acme"
)
constletsEncryptURLHTTP="http://acme-v02.api.letsencrypt.org/directory"constletsEncryptURLHTTPS="https://acme-v02.api.letsencrypt.org/directory"funcchangeToHTTP(url*string) {
ifstrings.HasPrefix(*url, "https:") {
*url="http"+ (*url)[len("https"):]
}
}
funcchangeToHTTPS(url*string) {
ifstrings.HasPrefix(*url, "http:") {
*url="https"+ (*url)[len("http"):]
}
}
funcTestHTTPURLs(t*testing.T) {
privateKey, err:=ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
iferr!=nil {
t.Fatalf("error generating a private key: %v", err)
}
func() {
t.Log("testing that Discover enforces https")
_, err:=New(&http.Client{
Transport: &httpsOnlyRoundTripper{inner: http.DefaultTransport},
Timeout: 20*time.Second,
}, "", letsEncryptURLHTTP, "", privateKey)
iferr!=nil {
t.Errorf("New error: %v", err)
}
}()
core, err:=New(&http.Client{
Transport: &httpsOnlyRoundTripper{inner: http.DefaultTransport},
Timeout: 20*time.Second,
}, "", letsEncryptURLHTTPS, "", privateKey)
iferr!=nil {
t.Fatalf("New error: %v", err)
}
func() {
t.Log("testing that account creation enforces https")
// Simulate a misconfigured CA that gives out HTTP directory URLs and when// we're done change it back to HTTPS to test the rest.changeToHTTP(&core.directory.NewAccountURL)
deferchangeToHTTPS(&core.directory.NewAccountURL)
_, err:=core.Accounts.New(acme.Account{
TermsOfServiceAgreed: true,
Contact: []string{},
})
iferr!=nil {
t.Errorf("core.Accounts.New error: %v", err)
}
}()
_, err=core.Accounts.New(acme.Account{
TermsOfServiceAgreed: true,
Contact: []string{},
})
iferr!=nil {
t.Fatalf("core.Accounts.New error: %v", err)
}
}
typehttpsOnlyRoundTripperstruct {
inner http.RoundTripper
}
func (r*httpsOnlyRoundTripper) RoundTrip(req*http.Request) (*http.Response, error) {
ifreq.URL.Scheme!="https" {
returnnil, fmt.Errorf("non-https request is being sent")
}
returnr.inner.RoundTrip(req)
}
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:
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:
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:
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:
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.
renovateBot
changed the title
Update module github.com/go-acme/lego/v4 to v4.25.2 [SECURITY]
Update module github.com/go-acme/lego/v4 to v4.25.2 [SECURITY] - abandoned
Mar 27, 2026
This PR has been flagged for autoclosing. However, it is being skipped due to the branch being already modified. Please close/delete it manually or report a bug if you think this is in error.
renovateBot
changed the title
Update module github.com/go-acme/lego/v4 to v4.25.2 [SECURITY] - abandoned
Update module github.com/go-acme/lego/v4 to v4.25.2 [SECURITY]
Mar 30, 2026
renovateBot
changed the title
Update module github.com/go-acme/lego/v4 to v4.25.2 [SECURITY]
Update module github.com/go-acme/lego/v4 to v4.25.2 [SECURITY] - abandoned
Apr 16, 2026
renovateBot
changed the title
Update module github.com/go-acme/lego/v4 to v4.25.2 [SECURITY] - abandoned
Update module github.com/go-acme/lego/v4 to v4.25.2 [SECURITY]
Apr 16, 2026
renovateBot
changed the title
Update module github.com/go-acme/lego/v4 to v4.25.2 [SECURITY]
Update module github.com/go-acme/lego/v4 to v4.34.0 [SECURITY]
Apr 16, 2026
renovateBot
changed the title
Update module github.com/go-acme/lego/v4 to v4.34.0 [SECURITY]
Update module github.com/go-acme/lego/v4 to v4.34.0 [SECURITY] - abandoned
Apr 27, 2026
renovateBot
changed the title
Update module github.com/go-acme/lego/v4 to v4.34.0 [SECURITY] - abandoned
Update module github.com/go-acme/lego/v4 to v4.34.0 [SECURITY]
Apr 27, 2026
renovateBot
changed the title
Update module github.com/go-acme/lego/v4 to v4.34.0 [SECURITY]
Update module github.com/go-acme/lego/v4 to v4.34.0 [SECURITY] - autoclosed
Jun 30, 2026
renovateBot
changed the title
Update module github.com/go-acme/lego/v4 to v4.34.0 [SECURITY]
Update module github.com/go-acme/lego/v4 to v4.34.0 [SECURITY] - autoclosed
Aug 17, 2026
renovateBot
changed the title
Update module github.com/go-acme/lego/v4 to v4.34.0 [SECURITY] - autoclosed
Update module github.com/go-acme/lego/v4 to v4.34.0 [SECURITY]
Aug 20, 2026
Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.
♻ Renovate will retry this branch, including artifacts, only when one of the following happens:
any of the package files in this branch needs updating, or
the branch becomes conflicted, or
you click the rebase/retry checkbox if found above, or
you rename this PR's title to start with "rebase!" to trigger it manually
The artifact failure details are included below:
File name: go.sum
Command failed: go get -t ./...
go: google.golang.org/genproto@v0.0.0-20230526161137-0005af68ea54 requires
cloud.google.com/go/accessapproval@v1.6.0 requires
google.golang.org/api@v0.103.0 requires
google.golang.org/genproto@v0.0.0-20221027153422-115e99e71e1c requires
cloud.google.com/go/apigateway@v1.3.0: verifying go.mod: cloud.google.com/go/apigateway@v1.3.0/go.mod: reading https://sum.golang.org/tile/8/0/x053/370: stream error: stream ID 3213; INTERNAL_ERROR; received from peer
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
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.13.3→v4.34.0github.com/go-acme/lego/v4/acme/api does not enforce HTTPS
CVE-2025-54799 / GHSA-q82r-2j7m-9rv4
More information
Details
Summary
It was discovered that the github.com/go-acme/lego/v4/acme/api package (thus the lego library and the lego cli as well) don't enforce HTTPS when talking to CAs as an ACME client.
Details
Unlike the http-01 challenge which solves an ACME challenge over unencrypted HTTP, the ACME protocol requires HTTPS when a client communicates with the CA to performs ACME functions. This is stated in 6.1 of RFC 8555: https://datatracker.ietf.org/doc/html/rfc8555#section-6.1
However, the library fails to enforce HTTPS both in the original discover URL (configured by the library user) and in the subsequent addresses returned by the CAs in the directory and order objects.
If the library user accidentally inputs an HTTP URL, or the CA similarly misconfigures its endpoints, this will cause the relevant parts of the protocol to be performed over HTTP. This can result, at the very least, in a lost of privacy of the request/response details, such as account and request identifiers (which could be intercepted by an attacker in a privileged network position). We did not investigate whether other more serious threats could result from the ability to impersonate a CA for some of the protocol requests, but enforcing HTTPS usage is definitely the safe choice.
Reproducing
This is illustrated in the attached http_acme_test.go. Since it uses private field Core.directory, this test must be placed inside the source directory of https://github.com/go-acme/lego/v4/acme/api to run.
Please note that this only checks getting the directory and creating a new account, but other ACME functions are likely impacted as well, such as creating orders, getting and checking order authorizations.
Details
_
Severity
CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:P/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:UReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
ACME 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
v4.31.0Compare Source
Added
Changed
Fixed
v4.30.1Due to an error related to
aliyun/credentials-go, some artifacts of the v4.30.0 release have not been published.This release contains the same things as v4.30.0.
v4.30.0Added
Changed
Fixed
v4.29.0Compare Source
Added
Changed
Fixed
v4.28.1Compare Source
Fixed
v4.28.0Compare Source
Added
Changed
Fixed
v4.27.0Compare Source
Added
Changed
--private-keywith a PKCS#8 keypairFixed
v4.26.0Compare Source
Added
Changed
Fixed
v4.25.2Compare Source
Changed
Fixed
v4.25.1Compare Source
Fixed
v4.25.0Compare Source
The binary size of this release is about ~50% smaller compared to previous releases.
This will also reduce the module cache usage by 320 MB (this will only affect users of lego as a library or who build lego themselves).
Added
Changed
Fixed
v4.24.0Compare Source
Added
Changed
Fixed
v4.23.1Compare Source
Due to an error related to Snapcraft, some artifacts of the v4.23.0 release have not been published.
This release contains the same things as v4.23.0.
v4.23.0Compare Source
Added
Changed
Fixed
alreadyReplacederrorReturnInfov4.22.2Compare Source
Fixed
v4.22.1Compare Source
Fixed
Added
v4.22.0Compare Source
Added
--private-keyflag to set the private key.LEGO_DEBUG_ACME_HTTP_CLIENTenvironment variable to debug the calls to the ACME server.LEGO_EMAILenvironment variable for specifying email.--hook-timeoutflag to run and renew commands.--http.delayoption for HTTP challenge.Changed
Removed
Fixed
v4.21.0Compare Source
Added
Fixed
v4.20.4Compare Source
Publish the Snap to the Snapcraft stable channel.
v4.20.3Compare Source
Fixed
v4.20.2Compare Source
Added
Changed
Fixed
v4.20.1Compare Source
Cancelled due to CI failure.
v4.20.0Compare Source
Cancelled due to CI failure.
v4.19.2Compare Source
Fixed
v4.19.1Compare Source
Fixed
v4.19.0Compare Source
Added
dns.propagation-rnsoptiondns.propagation-waitflagPropagationWaitfunctionChanged
dns.disable-cp, replaced bydns.propagation-disable-ans.Fixed
v4.18.0Compare Source
Added
Changed
Fixed
v4.17.4Compare Source
Fixed
v4.17.3Compare Source
Added
Changed
Fixed
v4.17.2Compare Source
Canceled due to a release failure related to Snapcraft.
The Snapcraft release are disabled for now.
v4.17.1Compare Source
Canceled due to a release failure related to oci-go-sdk.
The module
github.com/oracle/oci-go-sdk/v65usesgithub.com/gofrs/flockbut flock doesn't support some platform (like Solaris):Due to that we will remove the Solaris build.
v4.17.0Compare Source
Canceled due to a release failure related to Snapcraft.
v4.16.1Compare Source
Fixed
v4.16.0Compare Source
Added
Changed
Fixed
v4.15.0Compare Source
Added
Changed
Fixed
v4.14.2Compare Source
Changelog
a6ddcacPrepare release v4.14.25ef996echore: temporary workaround8a7fd67Detach v4.14.1v4.14.1Compare Source
Fixed
v4.14.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.