惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Engineering at Meta
Engineering at Meta
G
Google Developers Blog
WordPress大学
WordPress大学
M
MIT News - Artificial intelligence
D
DataBreaches.Net
云风的 BLOG
云风的 BLOG
爱范儿
爱范儿
Microsoft Security Blog
Microsoft Security Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Blog — PlanetScale
Blog — PlanetScale
T
Tailwind CSS Blog
S
SegmentFault 最新的问题
阮一峰的网络日志
阮一峰的网络日志
博客园 - 三生石上(FineUI控件)
酷 壳 – CoolShell
酷 壳 – CoolShell
Recent Announcements
Recent Announcements
T
The Blog of Author Tim Ferriss
I
InfoQ
MyScale Blog
MyScale Blog
V
V2EX
B
Blog
罗磊的独立博客
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(proxy): reject malformed debug proxy targets · opencl...
vincentkoc · 2026-05-14 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -35,6 +35,7 @@ Docs: https://docs.openclaw.ai

3535

- Browser tool: treat malformed node proxy `payloadJSON` responses as browser proxy failures instead of leaking raw JSON parser errors.

3636

- Gateway HTTP: match models, session kill, and session history route paths without trusting malformed Host headers, avoiding pre-auth 500s on those endpoints.

3737

- Google Meet/Codex: report malformed node proxy `payloadJSON` responses with plugin-owned errors instead of leaking raw JSON parser failures.

38+

- Debug proxy: reject malformed relative-form proxy targets with a controlled 400 response instead of letting URL parsing escape the request handler.

3839

- Models config/auth: stop inferring provider env-var markers from broad `^[A-Z_][A-Z0-9_]*$` strings, and resolve config-backed provider `apiKey` values only through structured env SecretRefs (`secrets.providers[id]` / `secrets.defaults`), so unrelated env vars cannot accidentally become provider credentials. Thanks @sallyom.

3940

- Media fetch: skip allocating and buffering the response body for bodyless media responses (HEAD probes and 204-style empty bodies), avoiding wasted heap on streams that carry no payload. Thanks @shakkernerd.

4041

- CLI/onboarding: forward provider-specific auth flags (e.g. `--openai-api-key`) through the onboarding wizard so they reach provider auth methods via `ctx.opts`, letting `--openai-api-key "$OPENAI_API_KEY"` skip the redundant "use existing env var?" prompt in non-interactive harnesses. (#81669) Thanks @sjf.

Original file line numberDiff line numberDiff line change

@@ -71,6 +71,24 @@ async function requestThroughProxy(proxyUrl: string, targetUrl: string): Promise

7171

return data;

7272

}

7373
74+

async function requestRawThroughProxy(proxyUrl: string, request: string): Promise<string> {

75+

const proxy = new URL(proxyUrl);

76+

const socket = new Socket();

77+

let data = "";

78+

socket.setEncoding("utf8");

79+

socket.on("data", (chunk) => {

80+

data += chunk;

81+

});

82+

await new Promise<void>((resolve, reject) => {

83+

socket.once("error", reject);

84+

socket.connect(Number(proxy.port), proxy.hostname, resolve);

85+

});

86+

socket.write(request);

87+

await new Promise<void>((resolve) => socket.once("end", resolve));

88+

socket.destroy();

89+

return data;

90+

}

91+
7492

async function startCanaryOrigin(): Promise<{

7593

requestCount: () => number;

7694

stop: () => Promise<void>;

@@ -188,4 +206,20 @@ describe("debug proxy managed-proxy direct upstream policy", () => {

188206

await origin.stop();

189207

}

190208

});

209+
210+

it("rejects malformed relative-form HTTP proxy targets before upstream handling", async () => {

211+

const server = await startDebugProxyServer({ settings: await makeSettings() });

212+

try {

213+

const response = await requestRawThroughProxy(

214+

server.proxyUrl,

215+

"GET /capture HTTP/1.1\r\nHost: [\r\nConnection: close\r\n\r\n",

216+

);

217+
218+

expect(response).toContain("400 Bad Request");

219+

expect(response).toContain("Connection: close");

220+

expect(response).toContain("Invalid proxy target URL");

221+

} finally {

222+

await server.stop();

223+

}

224+

});

191225

});

Original file line numberDiff line numberDiff line change

@@ -98,7 +98,34 @@ export async function startDebugProxyServer(params: {

9898
9999

const server = createServer(async (req: IncomingMessage, res: ServerResponse) => {

100100

const flowId = randomUUID();

101-

const target = normalizeTargetUrl(req);

101+

let target: URL;

102+

try {

103+

target = normalizeTargetUrl(req);

104+

} catch (error) {

105+

const message = "Invalid proxy target URL";

106+

store.recordEvent({

107+

sessionId: params.settings.sessionId,

108+

ts: Date.now(),

109+

sourceScope: "openclaw",

110+

sourceProcess: params.settings.sourceProcess,

111+

protocol: "http",

112+

direction: "local",

113+

kind: "error",

114+

flowId,

115+

method: req.method,

116+

host: req.headers.host,

117+

path: req.url ?? "",

118+

errorText: error instanceof Error ? error.message : String(error),

119+

});

120+

const responseBody = `${message}\n`;

121+

res.writeHead(400, {

122+

Connection: "close",

123+

"Content-Type": "text/plain; charset=utf-8",

124+

"Content-Length": Buffer.byteLength(responseBody),

125+

});

126+

res.end(responseBody);

127+

return;

128+

}

102129

try {

103130

assertDebugProxyDirectUpstreamAllowed();

104131

} catch (error) {