CVE-2025-54799: Github.com/go acme/lego Remote Code Execution Vulnerability
LOWCVE-2025-54799 is a LOW remote code execution vulnerability (CWE-319: Cleartext Transmission of Sensitive Information) affecting Github.com/go acme/lego libraries in the Go ecosystem. The issue involves github.com/go-acme/lego/v4/acme/api does not enforce https. Remediation is available by upgrading affected packages to version 4.25.2.
CVE-2025-54799 at a Glance
How to Fix CVE-2025-54799
To remediate this vulnerability, upgrade all affected Github.com/go acme/lego dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/go-acme/lego to Latest secure release
Upgrade github.com/go-acme/lego/v3 to Latest secure release
Upgrade github.com/go-acme/lego/v4 to 4.25.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/go-acme/lego
How to Check if You Are Affected
To determine whether your application is affected by CVE-2025-54799, inspect your project dependencies for Github.com/go acme/lego:
inspect dependencies for github.com/go-acme/lego
Analyze the terminal output to locate any version of Github.com/go acme/lego in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.25.2), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-319: Cleartext Transmission of Sensitive Information, where the product transmits sensitive or security-critical data in cleartext in a communication channel that can be sniffed by unauthorized actors. In Github.com/go acme/lego, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-54799 Affected Github.com/go acme/lego Versions
3 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/go-acme/lego
|
Go |
≤ 4.25.1
|
|
|
github.com/go-acme/lego/v3
|
Go |
≤ 4.25.1
|
|
|
github.com/go-acme/lego/v4
|
Go |
< 4.25.2
|
4.25.2
|
References
Frequently Asked Questions
What is CVE-2025-54799?
Which Github.com/go acme/lego versions are affected?
What version fixes CVE-2025-54799?
Is github.com/go-acme/lego affected?
Is github.com/go-acme/lego/v3 affected?
What CWE is associated with CVE-2025-54799?
How can I check Go dependencies for CVE-2025-54799?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-q82r-2j7m-9rv4",
"modified" : "2025-08-07T15:11:32Z",
"published" : "2025-08-06T17:08:52Z",
"aliases" : [ "CVE-2025-54799" ],
"summary" : "github.com/go-acme/lego/v4/acme/api does not enforce HTTPS",
"details" : "## Summary\n\nIt 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.\n\n## Details\n\nUnlike 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](https://datatracker.ietf.org/doc/html/rfc8555#section-6.1)\n\n> Each ACME function is accomplished by the client sending a sequence\n> of HTTPS requests to the server [[RFC2818](https://datatracker.ietf.org/doc/html/rfc2818)], carrying JSON messages\n> [[RFC8259](https://datatracker.ietf.org/doc/html/rfc8259)]. Use of HTTPS is REQUIRED. Each subsection of [Section 7](https://datatracker.ietf.org/doc/html/rfc8555#section-7)\n> below describes the message formats used by the function and the\n> order in which messages are sent.\n\nHowever, 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.\n\nIf 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.\n\n## Reproducing\n\nThis 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.\n\nPlease 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.\n\n<details>\n\n```go\npackage api\n\nimport (\n\t\"crypto/ecdsa\"\n\t\"crypto/elliptic\"\n\t\"crypto/rand\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/go-acme/lego/v4/acme\"\n)\n\nconst letsEncryptURLHTTP = \"http://acme-v02.api.letsencrypt.org/directory\"\nconst letsEncryptURLHTTPS = \"https://acme-v02.api.letsencrypt.org/directory\"\n\nfunc changeToHTTP(url *string) {\n\tif strings.HasPrefix(*url, \"https:\") {\n\t\t*url = \"http\" + (*url)[len(\"https\"):]\n\t}\n}\n\nfunc changeToHTTPS(url *string) {\n\tif strings.HasPrefix(*url, \"http:\") {\n\t\t*url = \"https\" + (*url)[len(\"http\"):]\n\t}\n}\n\nfunc TestHTTPURLs(t *testing.T) {\n\tprivateKey, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)\n\tif err != nil {\n\t\tt.Fatalf(\"error generating a private key: %v\", err)\n\t}\n\n\tfunc() {\n\t\tt.Log(\"testing that Discover enforces https\")\n\t\t_, err := New(&http.Client{\n\t\t\tTransport: &httpsOnlyRoundTripper{inner: http.DefaultTransport},\n\t\t\tTimeout: 20 * time.Second,\n\t\t}, \"\", letsEncryptURLHTTP, \"\", privateKey)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"New error: %v\", err)\n\t\t}\n\t}()\n\n\tcore, err := New(&http.Client{\n\t\tTransport: &httpsOnlyRoundTripper{inner: http.DefaultTransport},\n\t\tTimeout: 20 * time.Second,\n\t}, \"\", letsEncryptURLHTTPS, \"\", privateKey)\n\tif err != nil {\n\t\tt.Fatalf(\"New error: %v\", err)\n\t}\n\n\tfunc() {\n\t\tt.Log(\"testing that account creation enforces https\")\n\n\t\t// Simulate a misconfigured CA that gives out HTTP directory URLs and when\n\t\t// we're done change it back to HTTPS to test the rest.\n\t\tchangeToHTTP(&core.directory.NewAccountURL)\n\t\tdefer changeToHTTPS(&core.directory.NewAccountURL)\n\n\t\t_, err := core.Accounts.New(acme.Account{\n\t\t\tTermsOfServiceAgreed: true,\n\t\t\tContact: []string{},\n\t\t})\n\t\tif err != nil {\n\t\t\tt.Errorf(\"core.Accounts.New error: %v\", err)\n\t\t}\n\t}()\n\n\t_, err = core.Accounts.New(acme.Account{\n\t\tTermsOfServiceAgreed: true,\n\t\tContact: []string{},\n\t})\n\tif err != nil {\n\t\tt.Fatalf(\"core.Accounts.New error: %v\", err)\n\t}\n}\n\ntype httpsOnlyRoundTripper struct {\n\tinner http.RoundTripper\n}\n\nfunc (r *httpsOnlyRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {\n\tif req.URL.Scheme != \"https\" {\n\t\treturn nil, fmt.Errorf(\"non-https request is being sent\")\n\t}\n\treturn r.inner.RoundTrip(req)\n}\n```\n\n</details>\n\n_",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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:U"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/go-acme/lego"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "4.25.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/go-acme/lego/v3"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "4.25.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/go-acme/lego/v4"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.25.2"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 4.25.1"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/go-acme/lego/security/advisories/GHSA-q82r-2j7m-9rv4"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-54799"
}, {
"type" : "WEB",
"url" : "https://github.com/go-acme/lego/commit/238454b5f74f3cfcbb244ff0d0dc914a4ad44b96"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/go-acme/lego"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-319" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2025-08-06T17:08:52Z",
"nvd_published_at" : "2025-08-07T01:15:26Z"
}
}