CVE-2025-54799: Github.com/go acme/lego Remote Code Execution Vulnerability

LOW
Advisory Identifier: GHSA-q82r-2j7m-9rv4
CWE-319
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2025-54799
GHSA Identifier GHSA-q82r-2j7m-9rv4
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-319: Cleartext Transmission of Sensitive Information
Affected Product Github.com/go acme/lego
Package Ecosystem Go
Published Date
Last Updated

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.

github.com/go-acme/lego fixed: Latest secure release
Upgrade github.com/go-acme/lego to Latest secure release
github.com/go-acme/lego/v3 fixed: Latest secure release
Upgrade github.com/go-acme/lego/v3 to Latest secure release
github.com/go-acme/lego/v4 fixed: 4.25.2
Upgrade github.com/go-acme/lego/v4 to 4.25.2
Verify Direct and Transitive Dependencies

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

## 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](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](https://datatracker.ietf.org/doc/html/rfc2818)], carrying JSON messages > [[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) > 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> ```go package api import ( "crypto/ecdsa" "crypto/elliptic" "crypto/rand" "fmt" "net/http" "strings" "testing" "time" "github.com/go-acme/lego/v4/acme" ) const letsEncryptURLHTTP = "http://acme-v02.api.letsencrypt.org/directory" const letsEncryptURLHTTPS = "https://acme-v02.api.letsencrypt.org/directory" func changeToHTTP(url *string) { if strings.HasPrefix(*url, "https:") { *url = "http" + (*url)[len("https"):] } } func changeToHTTPS(url *string) { if strings.HasPrefix(*url, "http:") { *url = "https" + (*url)[len("http"):] } } func TestHTTPURLs(t *testing.T) { privateKey, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) if err != 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) if err != nil { t.Errorf("New error: %v", err) } }() core, err := New(&http.Client{ Transport: &httpsOnlyRoundTripper{inner: http.DefaultTransport}, Timeout: 20 * time.Second, }, "", letsEncryptURLHTTPS, "", privateKey) if err != 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) defer changeToHTTPS(&core.directory.NewAccountURL) _, err := core.Accounts.New(acme.Account{ TermsOfServiceAgreed: true, Contact: []string{}, }) if err != nil { t.Errorf("core.Accounts.New error: %v", err) } }() _, err = core.Accounts.New(acme.Account{ TermsOfServiceAgreed: true, Contact: []string{}, }) if err != nil { t.Fatalf("core.Accounts.New error: %v", err) } } type httpsOnlyRoundTripper struct { inner http.RoundTripper } func (r *httpsOnlyRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { if req.URL.Scheme != "https" { return nil, fmt.Errorf("non-https request is being sent") } return r.inner.RoundTrip(req) } ``` </details> _

CVE-2025-54799 Affected Github.com/go acme/lego Versions

3 component(s)
Fixed Versions:
4.25.2
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?
CVE-2025-54799 is a security vulnerability in Github.com/go acme/lego involving github.com/go-acme/lego/v4/acme/api does not enforce HTTPS under CWE-319: Cleartext Transmission of Sensitive Information.
Which Github.com/go acme/lego versions are affected?
Affected versions include releases prior to 4.25.2 across affected packages: github.com/go-acme/lego, github.com/go-acme/lego/v3, github.com/go-acme/lego/v4.
What version fixes CVE-2025-54799?
Upgrading to 4.25.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/go-acme/lego affected?
Yes, github.com/go-acme/lego is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
Is github.com/go-acme/lego/v3 affected?
Yes, github.com/go-acme/lego/v3 is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What CWE is associated with CVE-2025-54799?
CVE-2025-54799 is classified under CWE-319: Cleartext Transmission of Sensitive Information (The product transmits sensitive or security-critical data in cleartext in a communication channel that can be sniffed by unauthorized actors.).
How can I check Go dependencies for CVE-2025-54799?
Run the dependency tree command: 'inspect dependencies for github.com/go-acme/lego'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}