mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 05:21:23 +00:00
fix(security): enforce sandbox bridge auth
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
generateChutesPkce,
|
||||
parseOAuthCallbackInput,
|
||||
} from "../agents/chutes-oauth.js";
|
||||
import { isLoopbackHost } from "../gateway/net.js";
|
||||
|
||||
type OAuthPrompt = {
|
||||
message: string;
|
||||
@@ -44,6 +45,11 @@ async function waitForLocalCallback(params: {
|
||||
throw new Error(`Chutes OAuth redirect URI must be http:// (got ${params.redirectUri})`);
|
||||
}
|
||||
const hostname = redirectUrl.hostname || "127.0.0.1";
|
||||
if (!isLoopbackHost(hostname)) {
|
||||
throw new Error(
|
||||
`Chutes OAuth redirect hostname must be loopback (got ${hostname}). Use http://127.0.0.1:<port>/...`,
|
||||
);
|
||||
}
|
||||
const port = redirectUrl.port ? Number.parseInt(redirectUrl.port, 10) : 80;
|
||||
const expectedPath = redirectUrl.pathname || "/";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user