Medium

lobe-chat has an Open Redirect

  • Disclosed: 24.09.2025
  • Updated: 11.10.2026 10:22

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.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
npm package @lobehub/chat < 1.130.1 1.130.1

References

CVSS score 4.3/10
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N
Weakness (CWE)
CWE-601
Platform
npm
Package
@lobehub/chat
Disclosed
24.09.2025
Updated
11.10.2026 10:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-xph5-278p-26qx - CC BY 4.0

Vulnerability history: @lobehub/chat

All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.

All (11) in the archive
Total entries
11
First → latest
01.2024 02.2026
Without a fix
2
Exploited in attacks
0

Severity breakdown

  • Critical 2
  • High 1
  • Medium 6
  • Low 2

Disclosures per year

  1. 2024: 5
  2. 2025: 3
  3. 2026: 3
Severity:
  1. lobe-chat has an Open Redirect this entry
    Medium · 4.3 CVE-2025-59426 < 1.130.1 1.130.1
  2. High · 8.1 CVE-2024-32965 < 1.19.13 1.19.13
  3. Critical · 9.0 CVE-2024-32964 < 0.150.6 0.150.6

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.