Skip to content

lobe-chat has an Open Redirect

Moderate severity GitHub Reviewed Published Sep 24, 2025 in lobehub/lobe-chat • Updated Sep 26, 2025

Package

npm @lobehub/chat (npm)

Affected versions

< 1.130.1

Patched versions

1.130.1

Description

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

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

curl -i 'http://localhost:3210/oidc/callback/desktop?code=abc&state=test123' \
  -H 'X-Forwarded-Host: google.com' \
  -H 'X-Forwarded-Proto: https'

image

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.

References

@arvinxx arvinxx published to lobehub/lobe-chat Sep 24, 2025
Published to the GitHub Advisory Database Sep 24, 2025
Reviewed Sep 24, 2025
Published by the National Vulnerability Database Sep 25, 2025
Last updated Sep 26, 2025

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Unchanged
Confidentiality
None
Integrity
Low
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(11th percentile)

Weaknesses

URL Redirection to Untrusted Site ('Open Redirect')

A web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a Redirect. This simplifies phishing attacks. Learn more on MITRE.

CVE ID

CVE-2025-59426

GHSA ID

GHSA-xph5-278p-26qx

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.