CVE-2025-59426: @lobehub/chat Lobe-chat Has An Open Redirect Vulnerability

MODERATE
Advisory Identifier: GHSA-xph5-278p-26qx
CVSS 4.3
CWE-601
Published
Advisory Summary

CVE-2025-59426 is a MODERATE (CVSS 4.3) lobe-chat has an open redirect vulnerability (CWE-601: URL Redirection to Untrusted Site ('Open Redirect')) affecting @lobehub/chat libraries in the npm ecosystem. The issue involves lobe-chat has an open redirect. Remediation is available by upgrading affected packages to version 1.130.1.

CVE-2025-59426 at a Glance

CVE Identifier CVE-2025-59426
GHSA Identifier GHSA-xph5-278p-26qx
Severity MODERATE
CVSS v3.1 Base Score 4.3
CWE Classification CWE-601: URL Redirection to Untrusted Site ('Open Redirect')
Affected Product @lobehub/chat
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 4.3

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

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

How to Fix CVE-2025-59426

To remediate this vulnerability, upgrade all affected @lobehub/chat 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/chat fixed: 1.130.1
npm install @lobehub/chat@1.130.1
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/chat

How to Check if You Are Affected

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

npm ls @lobehub/chat

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

Note: The npm ls @lobehub/chat 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-601: URL Redirection to Untrusted Site ('Open Redirect'), where the web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect. In @lobehub/chat, 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

### **Description** --- > Vulnerability Overview > The project's OIDC redirect handling logic constructs the host and protocol of the final redirect URL based on the X-Forwarded-Host or Host headers and the X-Forwarded-Proto value. In deployments where a reverse proxy forwards client-supplied X-Forwarded-* headers to the origin as-is, or where the origin trusts them without validation, an attacker can inject an arbitrary host and trigger an open redirect that sends users to a malicious domain. > Vulnerable Code Analysis > ```bash const internalRedirectUrlString = await oidcService.getInteractionResult(uid, result); log('OIDC Provider internal redirect URL string: %s', internalRedirectUrlString); let finalRedirectUrl; try { finalRedirectUrl = correctOIDCUrl(request, new URL(internalRedirectUrlString)); } catch { finalRedirectUrl = new URL(internalRedirectUrlString); log('Warning: Could not parse redirect URL, using as-is: %s', internalRedirectUrlString); } return NextResponse.redirect(finalRedirectUrl, { headers: request.headers, status: 303, }); ``` https://github.com/lobehub/lobe-chat/blob/aa841a3879c30142720485182ad62aa0dbd74edc/src/app/(backend)/oidc/consent/route.ts#L113-L127 ### PoC --- > curl Example > ```bash curl -i 'http://localhost:3210/oidc/callback/desktop?code=abc&state=test123' \ -H 'X-Forwarded-Host: google.com' \ -H 'X-Forwarded-Proto: https' ``` <img width="1504" height="304" alt="image" src="https://github.com/user-attachments/assets/b71d937d-7be2-49db-8f3d-e07371912800" /> ### Impact --- - It can force users to redirect to untrusted external domains, leading to subsequent attacks such as phishing, credential harvesting, and session fixation. - It can disrupt the OAuth/OIDC flow user experience by redirecting users to malicious domains disguised as legitimate pages (even though this path doesn't directly include tokens, it can be exploited for social engineering attacks through redirect chains). - The impact can be amplified when redirect chains are combined with other vulnerabilities such as CSP bypass or cache poisoning.

CVE-2025-59426 Affected @lobehub/chat Versions

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

References

Frequently Asked Questions

What is CVE-2025-59426?
CVE-2025-59426 is a security vulnerability in @lobehub/chat involving lobe-chat has an Open Redirect under CWE-601: URL Redirection to Untrusted Site ('Open Redirect').
Which @lobehub/chat versions are affected?
Affected versions include releases prior to 1.130.1 across affected packages: @lobehub/chat.
What version fixes CVE-2025-59426?
Upgrading to 1.130.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @lobehub/chat affected?
Yes, @lobehub/chat is affected in releases prior to 1.130.1. Upgrade your dependency to 1.130.1 or later.
What is the CVSS score of CVE-2025-59426?
CVE-2025-59426 has a CVSS v3.1 base score of 4.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2025-59426?
CVE-2025-59426 is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect') (The web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect.).
How can I check npm dependencies for CVE-2025-59426?
Run the dependency tree command: 'npm ls @lobehub/chat'. 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-xph5-278p-26qx",
  "modified" : "2025-10-13T15:56:03Z",
  "published" : "2025-09-24T21:34:10Z",
  "aliases" : [ "CVE-2025-59426" ],
  "summary" : "lobe-chat has an Open Redirect",
  "details" : "### **Description**\n\n---\n\n> Vulnerability Overview\n> \n\nThe project's OIDC redirect handling logic constructs the host and protocol of the final redirect URL based on the X-Forwarded-Host or Host headers and the X-Forwarded-Proto value. In deployments where a reverse proxy forwards client-supplied X-Forwarded-* headers to the origin as-is, or where the origin trusts them without validation, an attacker can inject an arbitrary host and trigger an open redirect that sends users to a malicious domain.\n\n> Vulnerable Code Analysis\n> \n\n```bash\nconst internalRedirectUrlString = await oidcService.getInteractionResult(uid, result);\nlog('OIDC Provider internal redirect URL string: %s', internalRedirectUrlString);\n\nlet finalRedirectUrl;\ntry {\n  finalRedirectUrl = correctOIDCUrl(request, new URL(internalRedirectUrlString));\n} catch {\n  finalRedirectUrl = new URL(internalRedirectUrlString);\n  log('Warning: Could not parse redirect URL, using as-is: %s', internalRedirectUrlString);\n}\n\nreturn NextResponse.redirect(finalRedirectUrl, {\n  headers: request.headers,\n  status: 303,\n});\n```\n\nhttps://github.com/lobehub/lobe-chat/blob/aa841a3879c30142720485182ad62aa0dbd74edc/src/app/(backend)/oidc/consent/route.ts#L113-L127\n\n### PoC\n\n---\n\n> curl Example\n> \n\n```bash\ncurl -i 'http://localhost:3210/oidc/callback/desktop?code=abc&state=test123' \\\n  -H 'X-Forwarded-Host: google.com' \\\n  -H 'X-Forwarded-Proto: https'\n```\n\n<img width=\"1504\" height=\"304\" alt=\"image\" src=\"https://github.com/user-attachments/assets/b71d937d-7be2-49db-8f3d-e07371912800\" />\n\n\n### Impact\n\n---\n\n- It can force users to redirect to untrusted external domains, leading to subsequent attacks such as phishing, credential harvesting, and session fixation.\n- It can disrupt the OAuth/OIDC flow user experience by redirecting users to malicious domains disguised as legitimate pages (even though this path doesn't directly include tokens, it can be exploited for social engineering attacks through redirect chains).\n- The impact can be amplified when redirect chains are combined with other vulnerabilities such as CSP bypass or cache poisoning.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@lobehub/chat"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.130.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/lobehub/lobe-chat/security/advisories/GHSA-xph5-278p-26qx"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-59426"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/lobehub/lobe-chat/commit/70f52a3c1fadbd41a9db0e699d1e44d9965de445"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/lobehub/lobe-chat"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/lobehub/lobe-chat/blob/aa841a3879c30142720485182ad62aa0dbd74edc/src/app/(backend)/oidc/consent/route.ts#L113-L127"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-601" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-09-24T21:34:10Z",
    "nvd_published_at" : "2025-09-25T14:15:45Z"
  }
}