INCIDENT MAP

Browse / AI Framework and Platform Flaws / CVE-2025-59426

lobe-chat has an Open Redirect

CVE-2025-59426 ยท 2025-09-24 moderate

Class
AI Framework and Platform Flaws (filed by a model that read the advisory)
Technique
Other weaknesses
Affected
@lobehub/chat (npm)
CVSS
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N
EPSS
0.4% chance of exploitation in 30 days

How it works, in short

The OIDC redirect builds its target host from client-supplied forwarded headers, so an attacker can send users to an arbitrary domain. (Our summary, written by a model. The source text is below.)

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'

<img width="1504" height="304" alt="image" src="https://github.com/user-attachments/assets/b71d937d-7be2-49db-8f3d-e07371912800" />

Impact

---

References

Source: GitHub Advisory Database, used under CC BY 4.0.