Skip to content

Add proxy capture stack and QA Lab inspector - #64895

Merged
Takhoffman merged 9 commits into
mainfrom
codex/proxy-capture-landing
Apr 11, 2026
Merged

Takhoffman merged 9 commits into
mainfrom
codex/proxy-capture-landing

Conversation

@Takhoffman

Copy link
Copy Markdown
Contributor

Summary

  • add the proxy capture core, storage, CA, and CLI surfaces
  • expand transport capture coverage and route more provider/channel traffic into the shared seam
  • add QA Lab capture backend APIs and the Capture UI inspector/timeline workflow

Commit structure

  • 99c33cace0 Add proxy capture core and CLI
  • 1bc11e3b7a Expand transport capture coverage
  • 41daa6899a Add QA Lab capture backend
  • c5e001e18d Refine QA Lab capture UI

Validation

  • node scripts/test-projects.mjs src/proxy-capture/store.sqlite.test.ts src/proxy-capture/runtime.test.ts src/proxy-capture/coverage.test.ts src/cli/proxy-cli.test.ts
  • node scripts/test-projects.mjs src/agents/provider-transport-fetch.test.ts src/agents/openai-ws-connection.test.ts extensions/telegram/src/fetch.test.ts extensions/discord/src/monitor/provider.rest-proxy.test.ts extensions/microsoft/speech-provider.test.ts extensions/openai/tts.test.ts
  • node scripts/test-projects.mjs extensions/qa-lab/src/lab-server.test.ts
  • pnpm qa:lab:build
  • node scripts/test-projects.mjs extensions/qa-lab/src/lab-server.test.ts src/agents/provider-transport-fetch.test.ts src/proxy-capture/runtime.test.ts src/proxy-capture/coverage.test.ts

Notes

  • the repo commit hook still hits unrelated pre-existing TypeScript failures under src/auto-reply/*, so the scoped commits were recorded with direct targeted validation for this stack

@aisle-research-bot

aisle-research-bot Bot commented Apr 11, 2026 •

Copy link
Copy Markdown

🔒 Aisle Security Analysis

We found 7 potential security issue(s) in this PR:

# Severity Title
1 🟠 High Unbounded request/response body buffering in debug proxy capture can cause memory/disk exhaustion
2 🟠 High Unauthenticated forward proxy with unrestricted CONNECT tunneling (network pivot/SSRF)
3 🟠 High Unauthenticated capture purge/delete endpoints enable CSRF/unauthorized data destruction
4 🟠 High Privileged CA trust installation uses attacker-controlled certificate path (env override + symlink reuse)
5 🟠 High Unauthenticated QA Lab capture APIs expose stored proxy-capture payloads (headers/bodies/blobs) and allow destructive actions
6 🟡 Medium Path traversal / arbitrary file read via unvalidated capture blobId
7 🟡 Medium Captured proxy traffic persisted to disk without redaction (potential credential/token leakage)
1. 🟠 Unbounded request/response body buffering in debug proxy capture can cause memory/disk exhaustion
Property Value
Severity High
CWE CWE-400
Location src/proxy-capture/runtime.ts:249-256

Description

The debug proxy capture functionality buffers and persists entire HTTP request/response bodies without any size limit. When capture is enabled (via OPENCLAW_DEBUG_PROXY_ENABLED), an attacker-controlled endpoint (or a malicious user pointing the proxy at a large download) can trigger OOM / process crash and/or disk fill.

Key issues:

  • captureHttpExchange() clones the Response and reads the full body via arrayBuffer() into memory before persisting (Buffer.from(buffer)).
  • persistEventPayload() writes the full buffer to disk (gzip) and only truncates the preview stored in dataText.
  • The local proxy server implementation (startDebugProxyServer) fully buffers incoming request bodies and fully buffers upstream responses (chunks + Buffer.concat) before recording the event, again without any maximum size.

Vulnerable code (unbounded response buffering):

void params.response
  .clone()
  .arrayBuffer()
  .then((buffer) => {
    const responsePayload = persistEventPayload(store, {
      data: Buffer.from(buffer),
      contentType: params.response.headers.get("content-type") ?? undefined,
    });

Impact:

  • Large responses (e.g., multi-GB) will be fully read into memory.
  • Large payloads will be gzip-compressed synchronously and written to disk, enabling disk exhaustion over time.

Because this is controlled by environment variables, it is particularly risky when the proxy/capture is enabled in production-like contexts (QA lab, monitoring plugins, etc.).

Recommendation

Add hard limits and prefer streaming capture to avoid buffering full payloads.

Suggested approach:

  • Introduce a maximum capture size (e.g., OPENCLAW_DEBUG_PROXY_MAX_CAPTURE_BYTES, default maybe 1–10MB).
  • Enforce the limit both for request bodies and response bodies.
  • When exceeding the limit, store only a preview and record metadata (truncated: true, originalSize if known).
  • Avoid gzipSync/arrayBuffer() for large bodies; stream to a file with backpressure and a byte counter.

Example (limit response capture):

const MAX = settings.maxCaptureBytes ?? 10 * 1024 * 1024;
const cloned = params.response.clone();
const reader = cloned.body?.getReader();
let total = 0;
const chunks: Uint8Array[] = [];
while (reader) {
  const { value, done } = await reader.read();
  if (done) break;
  total += value.byteLength;
  if (total > MAX) {
    ​// record truncated preview + metadata
    break;
  }
  chunks.push(value);
}
const data = Buffer.concat(chunks.map((c) => Buffer.from(c)));

Also apply similar limits in src/proxy-capture/proxy-server.ts (readBody, chunks accumulation) and in persistEventPayload/writeCaptureBlob (do not gzip/write huge buffers).

2. 🟠 Unauthenticated forward proxy with unrestricted CONNECT tunneling (network pivot/SSRF)
Property Value
Severity High
CWE CWE-918
Location src/proxy-capture/proxy-server.ts:64-214

Description

The new debug proxy server (startDebugProxyServer) implements a full forward proxy:

  • For normal HTTP requests it accepts absolute-form URLs (e.g. http://169.254.169.254/latest/meta-data/...) and forwards them upstream.
  • For HTTPS it supports CONNECT and blindly tunnels to any host:port via net.connect().
  • There is no authentication, no ACL, and no restriction to loopback clients.
  • The CLI exposes --host allowing binding to non-loopback interfaces (e.g. 0.0.0.0). If the process is started with such a bind, any reachable network client can use it as an open proxy to access internal services and perform port scanning.

Vulnerable code:

​// binds to user-supplied host
const host = params.host?.trim() || "127.0.0.1";
server.listen(params.port ?? 0, host, ...);

​// CONNECT tunnel to arbitrary host/port
const parsed = parseConnectTarget(req.url);
const upstreamSocket = net.connect(port, hostname, () => {
  clientSocket.write("HTTP/1.1 200 Connection Established\r\n\r\n");
  clientSocket.pipe(upstreamSocket);
  upstreamSocket.pipe(clientSocket);
});

Recommendation

Mitigate open-proxy abuse by applying defense in depth:

  1. Hard-restrict binding to loopback by default and refuse non-loopback binds unless an explicit dangerous flag is provided.
  2. Add client authentication (e.g. random token header) and/or restrict clients to localhost.
  3. Add an allowlist/denylist for upstream targets (at minimum block link-local, private ranges, and localhost when bound non-loopback).

Example (loopback-only enforcement):

import { isIP } from "node:net";

function isLoopbackHost(host: string): boolean {
  const h = host.trim().toLowerCase();
  return h === "127.0.0.1" || h === "localhost" || h === "::1";
}

const host = params.host?.trim() || "127.0.0.1";
if (!isLoopbackHost(host) && !params.settings.allowRemoteProxy) {
  throw new Error("Refusing to bind debug proxy to non-loopback host without explicit override");
}

If remote binding is truly needed, require an auth token and validate it on every request/CONNECT before proxying.

3. 🟠 Unauthenticated capture purge/delete endpoints enable CSRF/unauthorized data destruction
Property Value
Severity High
CWE CWE-352
Location extensions/qa-lab/src/lab-server.ts:786-800

Description

The QA Lab HTTP server exposes destructive capture-management endpoints without any authentication/authorization or CSRF defenses:

  • POST /api/capture/purge calls captureStore.purgeAll()
  • POST /api/capture/delete-sessions calls captureStore.deleteSessions(sessionIds)

These endpoints:

  • Do not validate an auth token, session, Origin/Referer, or any CSRF nonce.
  • Accept raw request bodies parsed as JSON regardless of Content-Type (readJson reads bytes and JSON.parses them), which makes them reachable from a malicious webpage using fetch(..., { mode: 'no-cors', body: '{}' }) (simple requests can bypass CORS preflight).
  • Although the server defaults to binding 127.0.0.1, it is configurable via params.host; if bound to 0.0.0.0/LAN, any network client could invoke these endpoints directly. Even when bound to localhost only, localhost CSRF can still allow a malicious site visited in the browser to trigger data deletion on the developer machine.

Vulnerable code:

if (req.method === "POST" && url.pathname === "/api/capture/delete-sessions") {
  const body = (await readJson(req)) as { sessionIds?: unknown };
  ...
  result: captureStore.deleteSessions(sessionIds),
}
if (req.method === "POST" && url.pathname === "/api/capture/purge") {
  result: captureStore.purgeAll(),
}

Recommendation

Add protection for all state-changing endpoints (including these capture endpoints):

  1. Require an unguessable admin token (e.g., Authorization: Bearer ...) or cookie-bound session, and reject requests without it.
  2. Add CSRF defenses if using cookies:
    • Validate Origin/Referer headers (same-origin)
    • Use a CSRF token (double-submit cookie or synchronizer token)
  3. Consider binding strictly to localhost and refuse non-loopback binds unless explicitly opted in.

Example (token + origin check):

function requireAdmin(req: IncomingMessage) {
  const expected = process.env.QA_LAB_ADMIN_TOKEN;
  const auth = req.headers.authorization;
  if (!expected || auth !== `Bearer ${expected}`) throw new Error("unauthorized");
  const origin = req.headers.origin;
  if (origin && origin !== publicBaseUrl) throw new Error("bad origin");
}

if (req.method === "POST" && url.pathname === "/api/capture/purge") {
  requireAdmin(req);
  writeJson(res, 200, { result: captureStore.purgeAll() });
  return;
}
4. 🟠 Privileged CA trust installation uses attacker-controlled certificate path (env override + symlink reuse)
Property Value
Severity High
CWE CWE-427
Location scripts/proxy-install-ca.mjs:10-44

Description

The macOS CA installation script can be run with elevated privileges (to write to /Library/Keychains/System.keychain), but the certificate file it trusts is created/reused from a path derived from environment variables and is not validated for ownership/permissions/symlinks.

Impact when an admin runs scripts/proxy-install-ca.mjs (often via sudo) in an environment influenced by a lower-privileged user:

  • resolveDebugProxySettings() allows overriding certDir via OPENCLAW_DEBUG_PROXY_CERT_DIR (and indirectly via OPENCLAW_STATE_DIR/OPENCLAW_HOME/HOME).
  • ensureDebugProxyCa() will reuse existing root-ca.pem/root-ca-key.pem if they exist, without checking they are regular files, owned by the current user, not symlinks, and not world-writable.
  • The script then executes security add-trusted-cert ... ca.certPath, which will trust whatever file ca.certPath points to as a root CA in the System keychain.

This enables an attacker to:

  • Place an attacker-controlled root-ca.pem (or a symlink to one) in a directory the privileged script will use, causing the admin to install an attacker-controlled root CA.
  • Potentially exploit symlink/hardlink races in ensureDebugProxyCa() when generating files (openssl -keyout/-out follow symlinks), allowing overwrite of arbitrary files if run as root and the target directory is attacker-writable.

Vulnerable code (trusting path derived from env + no validation):

const settings = resolveDebugProxySettings();
const ca = await ensureDebugProxyCa(settings.certDir);
...
spawnSync(security, [
  "add-trusted-cert",
  "-k",
  "/Library/Keychains/System.keychain",
  ca.certPath,
]);

Recommendation

Treat CA generation/trust as a privileged operation and harden file/path handling.

Mitigations (recommended to combine):

  1. Do not accept env overrides when running elevated (or require an explicit CLI flag):

    • If process.getuid?.() === 0 (or SUDO_UID present), ignore OPENCLAW_DEBUG_PROXY_CERT_DIR/OPENCLAW_STATE_DIR and use a fixed, root-controlled directory.
  2. Use a root-owned, non-world-writable directory for CA material when installing into System.keychain (e.g. /var/db/openclaw/debug-proxy/certs), and set strict permissions.

  3. Refuse symlinks and enforce ownership/permissions before reuse/trust:

import fs from "node:fs";

function assertSafeFile(p: string) {
  const st = fs.lstatSync(p);
  if (!st.isFile() || st.isSymbolicLink()) throw new Error(`Unsafe CA path: ${p}`);
  ​// optionally enforce uid/gid match and mode <= 0o644 (and key <= 0o600)
}

​// before trusting:
assertSafeFile(ca.certPath);
  1. Generate files safely:

    • Create the cert directory with mode: 0o700.
    • Write to a temp file in the same directory then renameSync into place.
    • Consider using Node crypto APIs or a library to generate certs while controlling file creation flags (wx) to avoid following symlinks.
  2. Additional UX safety: print a fingerprint and require confirmation before trusting the CA.

5. 🟠 Unauthenticated QA Lab capture APIs expose stored proxy-capture payloads (headers/bodies/blobs) and allow destructive actions
Property Value
Severity High
CWE CWE-306
Location extensions/qa-lab/src/lab-server.ts:772-784

Description

The QA Lab HTTP server adds multiple unauthenticated endpoints that expose the Debug Proxy Capture store contents, including raw captured payloads and headers.

Impact:

  • Captured events include full headers_json and request/response bodies (persisted as data_text or data_blob_id) from captureHttpExchange() / captureWsEvent().
  • QA Lab exposes:
    • GET /api/capture/events (includes headersJson, dataText, and dataBlobId)
    • GET /api/capture/blob?id=... (returns raw blob content)
    • GET /api/capture/query / GET /api/capture/coverage
    • POST /api/capture/delete-sessions and POST /api/capture/purge (destructive)

Because startQaLabServer() binds to params?.host (default 127.0.0.1), deployments that set host to 0.0.0.0 / a non-loopback interface (or otherwise expose the port via container/K8s port-forward/ingress) would allow any network client to retrieve secrets (Authorization bearer tokens, cookies, bot tokens, prompts, audio/text payloads, etc.) and to delete capture history.

Vulnerable code (no auth/ACL checks before returning capture data):

if (req.method === "GET" && url.pathname === "/api/capture/blob") {
  const blobId = url.searchParams.get("id")?.trim();
  const content = captureStore.readBlob(blobId);
  writeJson(res, 200, { id: blobId, content });
  return;
}

Additionally, the server may listen on a caller-supplied host:

server.listen(params?.port ?? 0, params?.host ?? "127.0.0.1", () => resolve());

Recommendation

Add access control for all /api/capture/* endpoints and make safe defaults:

  1. Bind to loopback only and refuse non-loopback binds unless an explicit --insecure-listen flag is set.
  2. Require an auth token (e.g., Authorization: Bearer <token>) for all capture endpoints.
  3. Consider redacting sensitive headers/fields at capture time (e.g., authorization, cookie, set-cookie) or encrypting at rest.
  4. For blobs, avoid returning raw content by default; require explicit opt-in and stream with appropriate content-type.

Example (token gate):

function requireToken(req: IncomingMessage, expected: string): boolean {
  const header = req.headers.authorization;
  return typeof header === "string" && header === `Bearer ${expected}`;
}

​// before handling /api/capture/*
if (url.pathname.startsWith("/api/capture/")) {
  const token = process.env.QA_LAB_TOKEN;
  if (!token || !requireToken(req, token)) {
    writeError(res, 401, "Unauthorized");
    return;
  }
}
6. 🟡 Path traversal / arbitrary file read via unvalidated capture blobId
Property Value
Severity Medium
CWE CWE-22
Location src/proxy-capture/store.sqlite.ts:266-275

Description

DebugProxyCaptureStore.readBlob() constructs a filesystem path using a blobId value taken from SQLite (capture_events.data_blob_id) without validating that it is a safe filename.

  • The QA Lab HTTP endpoint GET /api/capture/blob?id=... passes a user-controlled query parameter directly to captureStore.readBlob(blobId).
  • readBlob() then uses path.join(this.blobDir, ${row.blobId}.bin.gz).
  • If an attacker can get a malicious data_blob_id stored in the SQLite DB (e.g., by DB tampering/poisoning or any future ingestion path that allows setting dataBlobId), values containing path separators like ../ could escape blobDir and read arbitrary .bin.gz files on disk.

Vulnerable code:

const blobPath = path.join(this.blobDir, `${row.blobId}.bin.gz`);
return fs.existsSync(blobPath) ? readCaptureBlobText(blobPath) : null;

Recommendation

Validate blobId before using it as a filename and enforce the same validation when writing/recording events.

  • Enforce a strict allowlist (these blob IDs are generated as 24 hex chars in writeCaptureBlob()): ^[a-f0-9]{24}$.
  • Additionally, build the path with path.resolve and verify it remains within blobDir.

Example fix:

function assertValidBlobId(blobId: string): string {
  const trimmed = blobId.trim();
  if (!/^[a-f0-9]{24}$/.test(trimmed)) {
    throw new Error("Invalid blob id");
  }
  return trimmed;
}

readBlob(blobId: string): string | null {
  const safeId = assertValidBlobId(blobId);
  const blobPath = path.resolve(this.blobDir, `${safeId}.bin.gz`);
  const rel = path.relative(this.blobDir, blobPath);
  if (rel.startsWith("..") || path.isAbsolute(rel)) {
    return null;
  }
  return fs.existsSync(blobPath) ? readCaptureBlobText(blobPath) : null;
}

Also consider returning an error for invalid IDs in the HTTP layer (/api/capture/blob).

7. 🟡 Captured proxy traffic persisted to disk without redaction (potential credential/token leakage)
Property Value
Severity Medium
CWE CWE-201
Location src/proxy-capture/proxy-server.ts:77-122

Description

The debug proxy capture implementation records full request/response headers and body previews (plus full payload blobs) into a local SQLite DB / blob store without any filtering.

This can capture and persist sensitive secrets such as:

  • Authorization, Cookie, API keys, session tokens
  • request/response bodies containing credentials, PII, or proprietary data

Vulnerable code (records headers and first 8KB of bodies):

headersJson: JSON.stringify(req.headers),
dataText: body.subarray(0, 8192).toString("utf8"),
...
headersJson: JSON.stringify(upstreamRes.headers),
dataText: responseBody.subarray(0, 8192).toString("utf8"),

While this is a debug feature, the change makes it easy to unintentionally retain secrets on disk, and the DB/blob files are created with default permissions (no explicit hardening).

Recommendation

Reduce the risk of secrets being written to disk:

  • Redact sensitive headers before persisting (e.g. authorization, cookie, set-cookie, x-api-key).
  • Consider an opt-in flag for body capture, or only capture bodies for certain content types.
  • Consider encrypting the capture store at rest, or at least setting restrictive file permissions.

Example header redaction:

function redactHeaders(headers: Record<string, unknown>) {
  const redacted = { ...headers } as Record<string, unknown>;
  for (const key of Object.keys(redacted)) {
    const k = key.toLowerCase();
    if (["authorization","cookie","set-cookie","x-api-key"].includes(k)) {
      redacted[key] = "[REDACTED]";
    }
  }
  return redacted;
}

​// when recording
headersJson: JSON.stringify(redactHeaders(req.headers as Record<string, unknown>)),

Also document prominently that running the proxy will store secrets and provide a simple purge command (already exists) plus a retention policy.


Analyzed PR: #64895 at commit 3a7b878

Last updated on: 2026-04-11T17:32:03Z

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord channel: mattermost Channel integration: mattermost channel: telegram Channel integration: telegram cli CLI command changes scripts Repository scripts agents Agent runtime and tooling extensions: openai extensions: qa-lab size: XL maintainer Maintainer-authored PR labels Apr 11, 2026
@greptile-apps

greptile-apps Bot commented Apr 11, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds a proxy capture core (SQLite store, CA, blob storage, proxy server), wires transport capture across provider and channel extensions, and adds a QA Lab capture backend with a UI inspector/timeline. The infrastructure design is solid, but every extension that adds capture hooks bypasses the newly-created openclaw/plugin-sdk/proxy-capture facade by importing directly from src/proxy-capture/**, violating the documented extension/SDK boundary.

  • captureHttpExchange, captureWsEvent, resolveEffectiveDebugProxyUrl, and createDebugProxyWebSocketAgent are absent from src/plugin-sdk/proxy-capture.ts; all five extension packages import them via raw src/** relative paths, which the architecture rules explicitly forbid.
  • In extensions/discord/src/monitor/gateway-plugin.ts, the wsFlowId is allocated once per createGatewayPlugin call and reused across all reconnection attempts (up to 50), conflating unrelated connection lifetimes under a single flow ID in the capture store.

Confidence Score: 4/5

Safe to merge after resolving the SDK boundary violations; the boundary break is an architectural correctness issue, not a runtime crash, but it creates enforcement debt that hardens with each passing merge.

One P1 (extension boundary violations across five extension packages) and two P2s remain. The P1 doesn't cause a runtime failure today but actively violates the documented plugin SDK contract and leaves captureHttpExchange/captureWsEvent/resolveEffectiveDebugProxyUrl/createDebugProxyWebSocketAgent as undeclared, unversioned public surfaces — which the architecture guide explicitly calls out as the kind of thing that makes later cleanup a major-version break.

extensions/discord/src/monitor/gateway-plugin.ts, extensions/telegram/src/fetch.ts, extensions/openai/realtime-voice-provider.ts, extensions/mattermost/src/mattermost/monitor-websocket.ts, extensions/microsoft/speech-provider.ts, extensions/qa-lab/src/lab-server.ts, src/plugin-sdk/proxy-capture.ts

Prompt To Fix All With AI
This is a comment left during a code review.
Path: extensions/discord/src/monitor/gateway-plugin.ts
Line: 10-11

Comment:
**Extension boundary violation: direct `src/**` imports**

Extensions must import through `openclaw/plugin-sdk/*`, never from `src/**` directly (see `extensions/CLAUDE.md` and project architecture rules). `captureHttpExchange`, `captureWsEvent`, `resolveEffectiveDebugProxyUrl`, and `createDebugProxyWebSocketAgent` are missing from `src/plugin-sdk/proxy-capture.ts`. These functions should be exported there and every extension import should be rewritten to `openclaw/plugin-sdk/proxy-capture`.

The same violation appears in `extensions/telegram/src/fetch.ts` (lines 14–15), `extensions/openai/realtime-voice-provider.ts` (lines 11–12), `extensions/mattermost/src/mattermost/monitor-websocket.ts` (lines 8–9), and `extensions/microsoft/speech-provider.ts` (line 16), plus `extensions/qa-lab/src/lab-server.ts` lines 17–19 (those three functions are already in the SDK but still imported via direct relative paths).

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: extensions/discord/src/monitor/gateway-plugin.ts
Line: 246

Comment:
**`wsFlowId` shared across reconnection attempts**

`wsFlowId` is allocated once in `createGatewayPlugin` and captured in the class closure. The gateway plugin configures `reconnect: { maxAttempts: 50 }`, so `startAsync` (and its WebSocket construction + event listeners) can run up to 50 times while sharing this single flow ID. Every `ws-open`, `ws-frame`, and `ws-close` event from all reconnection attempts will be grouped under the same flow, making it impossible to distinguish distinct connection lifetimes in the capture store.

Move the `randomUUID()` call inside the WebSocket setup block (inside `startAsync`) so each connection attempt gets its own flow ID.

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: extensions/discord/src/monitor/gateway-plugin.ts
Line: 363-378

Comment:
**Double capture when global fetch patch is active**

When `initializeDebugProxyCapture` is called (i.e. `OPENCLAW_DEBUG_PROXY_ENABLED=1`), `globalThis.fetch` is already patched by `installDebugProxyGlobalFetchPatch` to call `captureHttpExchange`. The `fetchImpl` here calls the global `fetch` (now patched) **and then** calls `captureHttpExchange` explicitly, recording each request twice in the capture store. The same issue is present in the proxy-path branch a few lines below.

Consider guarding the explicit call with `if (!settings.enabled)` (inverse) or checking that the transport is undici-based (which bypasses the global fetch patch).

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "Refine QA Lab capture UI" | Re-trigger Greptile

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c5e001e18d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/proxy-capture/store.sqlite.ts Resolved
Comment thread src/cli/proxy-cli.runtime.ts Resolved
@blacksmith-sh

This comment has been minimized.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 74e2103974

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/cli/proxy-cli.runtime.ts Resolved
Comment thread extensions/openai/tts.ts Resolved

Copy link
Copy Markdown
Contributor Author

Addressed the two new concrete follow-ups in c52790645f.

Fixed in this push:

  • proxy run now guarantees server.stop() and endSession(sessionId) in a finally, so spawn failures do not strand the proxy listener or leave unfinished sessions
  • OpenAI TTS now skips explicit captureHttpExchange(...) when the debug proxy global fetch patch is already installed, avoiding duplicate request/response capture
  • added focused regressions for both cases:
    • src/cli/proxy-cli.runtime.test.ts
    • extensions/openai/tts.test.ts

Focused validation run after the fix:

  • node scripts/test-projects.mjs src/cli/proxy-cli.runtime.test.ts src/cli/proxy-cli.test.ts extensions/openai/tts.test.ts src/proxy-capture/runtime.test.ts src/agents/openai-ws-connection.test.ts

The broader Aisle security hardening sweep is still separate from this narrow follow-up.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c52790645f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/provider-transport-fetch.ts Resolved
Comment thread extensions/microsoft/speech-provider.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

const candidate = path.normalize(path.join(distDir, decoded));
if (!candidate.startsWith(distDir)) {
return null;

P1 Badge Harden QA Lab asset path boundary validation

The containment check uses candidate.startsWith(distDir), which is bypassable for sibling paths sharing the same prefix (for example, requesting /../dist2/secret.txt when distDir ends in dist). That lets tryResolveUiAsset serve files outside the intended UI directory instead of falling back to index.html, creating a directory traversal exposure on the QA Lab HTTP server.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/proxy-capture/proxy-server.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

const candidate = path.normalize(path.join(distDir, decoded));
if (!candidate.startsWith(distDir)) {
return null;

P2 Badge Harden QA Lab asset path containment check

The containment guard uses candidate.startsWith(distDir), which is only a string-prefix check and can be bypassed by sibling paths that share the prefix (for example .../dist-other/...). That means crafted paths like /../dist-other/file can be treated as in-root and served when present, leaking files outside the intended UI bundle directory. Use a real path-boundary check (for example path.relative + ../absolute validation) instead of raw startsWith.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Contributor Author

Addressed the new QA Lab asset-path follow-up in 3a7b878aa0.

Fixed in this push:

  • replaced the raw candidate.startsWith(distDir) check in tryResolveUiAsset with a real path-boundary test using path.resolve(...) + path.relative(...)
  • added a focused regression in extensions/qa-lab/src/lab-server.test.ts that creates sibling dist / dist-other directories and verifies GET /../dist-other/secret.txt falls back to the UI bundle instead of serving the sibling file

Focused validation run after the fix:

  • node scripts/test-projects.mjs extensions/qa-lab/src/lab-server.test.ts

The broader Aisle security sweep remains a separate hardening track from these narrow correctness follow-ups.

lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
…64895)

* Add proxy capture core and CLI

* Expand transport capture coverage

* Add QA Lab capture backend

* Refine QA Lab capture UI

* Fix proxy capture review feedback

* Fix proxy run cleanup and TTS capture

* Fix proxy capture transport follow-ups

* Fix debug proxy CONNECT target parsing

* Harden QA Lab asset path containment
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
…64895)

* Add proxy capture core and CLI

* Expand transport capture coverage

* Add QA Lab capture backend

* Refine QA Lab capture UI

* Fix proxy capture review feedback

* Fix proxy run cleanup and TTS capture

* Fix proxy capture transport follow-ups

* Fix debug proxy CONNECT target parsing

* Harden QA Lab asset path containment
@clawsweeper clawsweeper Bot mentioned this pull request May 5, 2026
8 of 22 tasks
globalcaos pushed a commit to globalcaos/tinkerclaw that referenced this pull request May 13, 2026
…64895)

* Add proxy capture core and CLI

* Expand transport capture coverage

* Add QA Lab capture backend

* Refine QA Lab capture UI

* Fix proxy capture review feedback

* Fix proxy run cleanup and TTS capture

* Fix proxy capture transport follow-ups

* Fix debug proxy CONNECT target parsing

* Harden QA Lab asset path containment
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
…64895)

* Add proxy capture core and CLI

* Expand transport capture coverage

* Add QA Lab capture backend

* Refine QA Lab capture UI

* Fix proxy capture review feedback

* Fix proxy run cleanup and TTS capture

* Fix proxy capture transport follow-ups

* Fix debug proxy CONNECT target parsing

* Harden QA Lab asset path containment
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
…64895)

* Add proxy capture core and CLI

* Expand transport capture coverage

* Add QA Lab capture backend

* Refine QA Lab capture UI

* Fix proxy capture review feedback

* Fix proxy run cleanup and TTS capture

* Fix proxy capture transport follow-ups

* Fix debug proxy CONNECT target parsing

* Harden QA Lab asset path containment
vixco pushed a commit to vixco/openclaw that referenced this pull request Aug 16, 2026
…64895)

* Add proxy capture core and CLI

* Expand transport capture coverage

* Add QA Lab capture backend

* Refine QA Lab capture UI

* Fix proxy capture review feedback

* Fix proxy run cleanup and TTS capture

* Fix proxy capture transport follow-ups

* Fix debug proxy CONNECT target parsing

* Harden QA Lab asset path containment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: discord Channel integration: discord channel: mattermost Channel integration: mattermost channel: telegram Channel integration: telegram cli CLI command changes extensions: openai extensions: qa-lab maintainer Maintainer-authored PR scripts Repository scripts size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant