Vulnerabilities in pkg:pypi/lnbits

PACKAGE
Advisory Identifier: GHSA-qp8j-p87f-c8cc
Advisory Summary

CVE-2025-32013 is a CRITICAL lnbits lightning network payment system vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Lnbits libraries in the PyPI ecosystem. The issue involves lnbits lightning network payment system vulnerable to server-side request forgery via lnurl authentication callback. Remediation is available in the latest vendor maintenance releases.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/lnbits

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/lnbits. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-qp8j-p87f-c8cc CVE-2025-32013 CRITICAL LNbits Lightning Network Payment System Vulnerable to Server-Side Request Forgery via LNURL Authentication Callback
GHSA-3j4h-h3fp-vwww CVE-2024-34694 HIGH LNbits improperly handles potential network and payment failures when using Eclair backend

CVE-2025-32013 at a Glance

CVE Identifier CVE-2025-32013
GHSA Identifier GHSA-qp8j-p87f-c8cc
Severity CRITICAL
CVSS v3.1 Base Score N/A
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
Affected Product Lnbits
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix CVE-2025-32013

To remediate this vulnerability, upgrade all affected Lnbits dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

lnbits fixed: Latest secure release
pip install lnbits>=Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show lnbits

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2025-32013, inspect your installed packages using pip:

pip show lnbits

Analyze the terminal output to locate any version of Lnbits in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.

Note: The pip show lnbits command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. In Lnbits, 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

# Server-Side Request Forgery via LNURL Authentication Callback in LNbits Lightning Network Payment System ## Disclaimer This vulnerability was detected using **[XBOW](https://xbow.com/)**, a system that autonomously finds and exploits potential security vulnerabilities. The finding has been thoroughly reviewed and validated by a security researcher before submission. While XBOW is intended to work autonomously, during its development human experts ensure the accuracy and relevance of its reports. ## Description A Server-Side Request Forgery (SSRF) vulnerability has been discovered in LNbits' LNURL authentication handling functionality. The vulnerability exists in the LNURL authentication callback process where the application makes HTTP requests to user-provided callback URLs and follows redirects without proper validation. When processing LNURL authentication requests, the application accepts a callback URL parameter and makes an HTTP request to that URL using the httpx library with redirect following enabled. The application doesn't properly validate the callback URL, allowing attackers to specify internal network addresses and access internal resources. This vulnerability allows an attacker to make the application send HTTP requests to arbitrary internal network locations, potentially exposing sensitive information or accessing internal services that should not be accessible from the internet. ## Steps to Reproduce 1. Create a new wallet account to get an admin key: ``` curl -X POST http://target:5000/api/v1/account -d '{"name":"test"}' ``` 2. Use the obtained admin key to send a crafted LNURL authentication request: ``` curl -X POST http://target:5000/api/v1/lnurlauth \ -H "X-Api-Key: <admin_key>" \ -H "Content-Type: application/json" \ -d '{ "callback": "http://target-internal-server/?tag=login&k1=9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08", "k1": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08", "sig": "0"*128, "key": "0"*64 }' ``` The application will make an HTTP request to the internal URL specified in the callback parameter and return its contents in the response, allowing access to internal resources that should not be accessible. ## Mitigations - Implement strict URL validation for callback URLs, ensuring they only point to allowed domains and networks. - Use a whitelist of allowed domains and IP ranges for callback URLs. - Disable redirect following in HTTP requests or implement strict redirect validation. - Consider using a proxy service that restricts access to internal networks when making external HTTP requests. ## Impact This vulnerability allows authenticated attackers to access internal network resources that should not be accessible from the internet. While authentication is required to exploit this vulnerability, any user who can create a wallet gets the necessary access level. The vulnerability can be used to read internal files, access internal services, and potentially expose sensitive information from the internal network. ## Disclosure Policy This bug is subject to a 90-day disclosure deadline. If a fix for this issue is made available to users before the end of the 90-day deadline, this bug report will become public 15 days after the fix was made available. Regardless of this disclosure process, XBOW may privately notify other affected parties as soon as we become aware of this vulnerability.

CVE-2025-32013 Affected Lnbits Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
lnbits
PyPI
≤ 0.12.12

References

Frequently Asked Questions

What is CVE-2025-32013?
CVE-2025-32013 is a security vulnerability in Lnbits involving LNbits Lightning Network Payment System Vulnerable to Server-Side Request Forgery via LNURL Authentication Callback under CWE-918: Server-Side Request Forgery (SSRF).
Which Lnbits versions are affected?
Affected versions include releases prior to current release patches across affected packages: lnbits.
What version fixes CVE-2025-32013?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is lnbits affected?
Yes, lnbits 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-32013?
CVE-2025-32013 is classified under CWE-918: Server-Side Request Forgery (SSRF) (The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.).
How can I check PyPI dependencies for CVE-2025-32013?
Run the dependency tree command: 'pip show lnbits'. 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-qp8j-p87f-c8cc",
  "modified" : "2025-04-10T01:55:57Z",
  "published" : "2025-04-07T16:54:36Z",
  "aliases" : [ "CVE-2025-32013" ],
  "summary" : "LNbits Lightning Network Payment System Vulnerable to Server-Side Request Forgery via LNURL Authentication Callback",
  "details" : "# Server-Side Request Forgery via LNURL Authentication Callback in LNbits Lightning Network Payment System\n\n## Disclaimer\n\nThis vulnerability was detected using **[XBOW](https://xbow.com/)**, a system that autonomously finds and exploits potential security vulnerabilities. The finding has been thoroughly reviewed and validated by a security researcher before submission. While XBOW is intended to work autonomously, during its development human experts ensure the accuracy and relevance of its reports.\n\n## Description\n\nA Server-Side Request Forgery (SSRF) vulnerability has been discovered in LNbits' LNURL authentication handling functionality. The vulnerability exists in the LNURL authentication callback process where the application makes HTTP requests to user-provided callback URLs and follows redirects without proper validation.\n\nWhen processing LNURL authentication requests, the application accepts a callback URL parameter and makes an HTTP request to that URL using the httpx library with redirect following enabled. The application doesn't properly validate the callback URL, allowing attackers to specify internal network addresses and access internal resources.\n\nThis vulnerability allows an attacker to make the application send HTTP requests to arbitrary internal network locations, potentially exposing sensitive information or accessing internal services that should not be accessible from the internet.\n\n## Steps to Reproduce\n\n1. Create a new wallet account to get an admin key:\n\n```\ncurl -X POST http://target:5000/api/v1/account -d '{\"name\":\"test\"}'\n```\n\n2. Use the obtained admin key to send a crafted LNURL authentication request:\n\n```\ncurl -X POST http://target:5000/api/v1/lnurlauth \\\n  -H \"X-Api-Key: <admin_key>\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"callback\": \"http://target-internal-server/?tag=login&k1=9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08\",\n    \"k1\": \"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08\",\n    \"sig\": \"0\"*128,\n    \"key\": \"0\"*64\n  }'\n```\n\nThe application will make an HTTP request to the internal URL specified in the callback parameter and return its contents in the response, allowing access to internal resources that should not be accessible.\n\n## Mitigations\n\n- Implement strict URL validation for callback URLs, ensuring they only point to allowed domains and networks.\n- Use a whitelist of allowed domains and IP ranges for callback URLs.\n- Disable redirect following in HTTP requests or implement strict redirect validation.\n- Consider using a proxy service that restricts access to internal networks when making external HTTP requests.\n\n## Impact\n\nThis vulnerability allows authenticated attackers to access internal network resources that should not be accessible from the internet. While authentication is required to exploit this vulnerability, any user who can create a wallet gets the necessary access level. The vulnerability can be used to read internal files, access internal services, and potentially expose sensitive information from the internal network.\n\n## Disclosure Policy\n\nThis bug is subject to a 90-day disclosure deadline. If a fix for this issue is made available to users before the end of the 90-day deadline, this bug report will become public 15 days after the fix was made available. Regardless of this disclosure process, XBOW may privately notify other affected parties as soon as we become aware of this vulnerability.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "lnbits"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "0.12.12"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/lnbits/lnbits/security/advisories/GHSA-qp8j-p87f-c8cc"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-32013"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/lnbits/lnbits"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/lnbits/PYSEC-2025-16.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-918" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-04-07T16:54:36Z",
    "nvd_published_at" : "2025-04-06T20:15:15Z"
  }
}