Description


Vulnerability Overview

Vulnerable Code

https://github.com/onlook-dev/onlook/blob/53ec325c06bc026a0fe64fde69070b3fe7b0cb90/apps/web/client/src/app/auth/callback/route.ts#L37-L44

const forwardedHost = request.headers.get('x-forwarded-host');

// Redirect to the redirect page which will handle the return URL
if (forwardedHost) {
    const forwardedProto = request.headers.get('x-forwarded-proto') || 'https';
    return NextResponse.redirect(`${forwardedProto}://${forwardedHost}${Routes.AUTH_REDIRECT}`);
} else {
    return NextResponse.redirect(`${origin}${Routes.AUTH_REDIRECT}`);
}

PoC


PoC Description