NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · LobeChat

CVE-2025-59426: lobe-chat has an Open Redirect

mediumCVSS 3.1 4.3GHSA-xph5-278p-26qx

LobeChat builds its OIDC redirect URL from the `X-Forwarded-Host`, `Host` and `X-Forwarded-Proto` headers. A request with `X-Forwarded-Host: google.com` makes the server redirect users to an attacker-chosen domain. The npm package `@lobehub/chat` is affected before 1.130.1. Upgrade to 1.130.1.

Published Sep 24, 2025 · Updated Sep 26, 2025 · Analysis Nov 1, 2026

What an attacker can do

In src/app/(backend)/oidc/consent/route.ts, the code gets an internal redirect URL from the OIDC service and passes it through correctOIDCUrl(request, ...). That helper rewrites the host and protocol using request headers. The result goes to NextResponse.redirect with status 303. If a reverse proxy passes client-supplied X-Forwarded-* headers through, or the origin trusts them, an attacker controls the destination.

The PoC is a single request: GET /oidc/callback/desktop?code=abc&state=test123 with X-Forwarded-Host: google.com and X-Forwarded-Proto: https. The response redirects to the injected host.

The attacker needs to get a victim to open a crafted link or flow, so the CVSS vector sets user interaction to required. The result is an open redirect: phishing, credential harvesting and session fixation on a domain the user first reached through your LobeChat instance. The advisory says the path does not directly carry tokens. It adds that chaining with other flaws, such as a CSP bypass or cache poisoning, can raise the impact.

Who is affected

Affected: @lobehub/chat before 1.130.1, in deployments where OIDC is in use and the app sits behind a proxy that forwards client X-Forwarded-* headers unchanged, or is reachable directly. A proxy that overwrites those headers removes the easy attack path.

Check your version:

npm ls @lobehub/chat

For Docker, check the image tag you deployed.

@lobehub/chat

Ecosystem
npm
Affected
< 1.130.1
Fixed in
1.130.1
Check
npm ls @lobehub/chat

How to fix it

Upgrade to @lobehub/chat 1.130.1:

npm install @lobehub/[email protected]

The fix is commit 70f52a3. The advisory gives no workaround. You can reduce exposure by configuring your reverse proxy to overwrite X-Forwarded-Host and X-Forwarded-Proto rather than pass client values, and by not exposing the origin directly.

How to tell if you were hit

Search access logs for requests to /oidc/callback/* or /oidc/consent that carry an X-Forwarded-Host value that is not your own domain, and for 303 responses whose Location points elsewhere. Check proxy logs for external hostnames in forwarded-host headers. Test your own instance with the PoC curl command and look at the Location header.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

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'

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.

Credited to im-soohyun.

Questions

Does this leak OIDC tokens?

The advisory says the redirect path does not directly include tokens. The harm is phishing and session fixation after a user lands on a malicious domain, and larger impact if chained with other flaws.

Which LobeChat version fixes CVE-2025-59426?

@lobehub/chat 1.130.1. Versions below it are vulnerable.

Am I safe behind a reverse proxy?

Only if the proxy replaces the X-Forwarded-* headers. The advisory limits the risk to setups where the proxy forwards client-supplied values as-is, or where the origin trusts them without validation.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More LobeChat vulnerabilities

All LobeChat entries