GHSA-xph5-278p-26qx

Suggest an improvement
Source
https://github.com/advisories/GHSA-xph5-278p-26qx
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/09/GHSA-xph5-278p-26qx/GHSA-xph5-278p-26qx.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-xph5-278p-26qx
Aliases
Published
2025-09-24T21:34:10Z
Modified
2026-09-10T03:50:29Z
Severity
  • 4.3 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N CVSS Calculator
Summary
lobe-chat has an Open Redirect
Details

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.
Database specific
{
    "cwe_ids":  [
        "CWE-601"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2025-09-24T21:34:10Z",
    "nvd_published_at":  "2025-09-25T14:15:45Z",
    "severity":  "MODERATE"
}
References

Affected packages

npm / @lobehub/chat

Package

Name
@lobehub/chat
View open source insights on deps.dev
Purl
pkg:npm/%40lobehub/chat

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
1.130.1

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/09/GHSA-xph5-278p-26qx/GHSA-xph5-278p-26qx.json"