@teamclaws/teamclaw 2026.11.8 → 2026.11.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,6 +9,9 @@
9
9
  import http from "node:http";
10
10
  import zlib from "node:zlib";
11
11
  import { sendJson } from "../protocol.js";
12
+ /** Opaque-origin sandbox applied to every preview-proxy response. */
13
+ export const PREVIEW_SANDBOX_CSP = "sandbox allow-scripts allow-forms";
14
+ ;
12
15
  /**
13
16
  * Headers the preview proxy never forwards to the untrusted preview
14
17
  * subprocess (ClawHub security review 2026.11.7 finding 2): every
@@ -85,6 +88,12 @@ export function handlePreviewProxyRequest(deps, req, res, requestUrl, pathname)
85
88
  }, (proxyRes) => {
86
89
  // Same review: never let the preview plant cookies on the controller origin.
87
90
  delete proxyRes.headers["set-cookie"];
91
+ // Every preview response is served under the controller origin (the proxy
92
+ // path), not just text/html: SVG, XHTML and XML passthrough are active
93
+ // documents too (2026.11.8 rescan finding). A response-level sandbox CSP
94
+ // gives each of them an opaque origin; for non-document resources (js,
95
+ // css, images) the directive is simply ignored.
96
+ proxyRes.headers["content-security-policy"] = PREVIEW_SANDBOX_CSP;
88
97
  const contentType = (proxyRes.headers["content-type"] ?? "").toLowerCase();
89
98
  if (proxyRes.statusCode !== 200 && proxyRes.statusCode !== 201 && proxyRes.statusCode !== 301 && proxyRes.statusCode !== 302 && proxyRes.statusCode !== 304) {
90
99
  res.writeHead(proxyRes.statusCode ?? 502, proxyRes.headers);
@@ -120,11 +129,8 @@ export function handlePreviewProxyRequest(deps, req, res, requestUrl, pathname)
120
129
  // We've decoded and rewritten the body — remove upstream encoding headers.
121
130
  delete resHeaders["content-encoding"];
122
131
  delete resHeaders["transfer-encoding"];
123
- // Preview HTML executes under the controller origin (the proxy path),
124
- // so give it the same opaque-origin sandbox the raw workspace route
125
- // uses (2026.11.6 finding 6): scripts run, but cannot read the
126
- // controller session or call /api/v1/* same-origin.
127
- resHeaders["content-security-policy"] = "sandbox allow-scripts allow-forms";
132
+ // Preview HTML executes under the controller origin (the proxy path);
133
+ // the sandbox CSP was already applied to the shared header object above.
128
134
  resHeaders["content-length"] = String(Buffer.byteLength(rewritten, "utf-8"));
129
135
  res.writeHead(proxyRes.statusCode ?? 200, resHeaders);
130
136
  res.end(rewritten);
@@ -2,7 +2,7 @@
2
2
  "id": "teamclaw",
3
3
  "name": "TeamClaw",
4
4
  "description": "Virtual team collaboration - multiple OpenClaw instances form a virtual software company with role-based task routing.",
5
- "version": "2026.11.8",
5
+ "version": "2026.11.9",
6
6
  "activation": {
7
7
  "onStartup": true
8
8
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamclaws/teamclaw",
3
- "version": "2026.11.8",
3
+ "version": "2026.11.9",
4
4
  "description": "OpenClaw virtual software team orchestration plugin - controller, role-based workers, Web UI with internet tunnel sharing",
5
5
  "private": false,
6
6
  "keywords": [
@@ -13,6 +13,9 @@ import type { PluginLogger } from "../../api.js";
13
13
  import type { TeamState } from "../types.js";
14
14
  import { sendJson } from "../protocol.js";
15
15
 
16
+ /** Opaque-origin sandbox applied to every preview-proxy response. */
17
+ export const PREVIEW_SANDBOX_CSP = "sandbox allow-scripts allow-forms";;
18
+
16
19
  /**
17
20
  * Headers the preview proxy never forwards to the untrusted preview
18
21
  * subprocess (ClawHub security review 2026.11.7 finding 2): every
@@ -109,6 +112,12 @@ export function handlePreviewProxyRequest(
109
112
  (proxyRes: http.IncomingMessage) => {
110
113
  // Same review: never let the preview plant cookies on the controller origin.
111
114
  delete proxyRes.headers["set-cookie"];
115
+ // Every preview response is served under the controller origin (the proxy
116
+ // path), not just text/html: SVG, XHTML and XML passthrough are active
117
+ // documents too (2026.11.8 rescan finding). A response-level sandbox CSP
118
+ // gives each of them an opaque origin; for non-document resources (js,
119
+ // css, images) the directive is simply ignored.
120
+ proxyRes.headers["content-security-policy"] = PREVIEW_SANDBOX_CSP;
112
121
  const contentType = (proxyRes.headers["content-type"] ?? "").toLowerCase();
113
122
  if (proxyRes.statusCode !== 200 && proxyRes.statusCode !== 201 && proxyRes.statusCode !== 301 && proxyRes.statusCode !== 302 && proxyRes.statusCode !== 304) {
114
123
  res.writeHead(proxyRes.statusCode ?? 502, proxyRes.headers);
@@ -148,11 +157,8 @@ export function handlePreviewProxyRequest(
148
157
  // We've decoded and rewritten the body — remove upstream encoding headers.
149
158
  delete resHeaders["content-encoding"];
150
159
  delete resHeaders["transfer-encoding"];
151
- // Preview HTML executes under the controller origin (the proxy path),
152
- // so give it the same opaque-origin sandbox the raw workspace route
153
- // uses (2026.11.6 finding 6): scripts run, but cannot read the
154
- // controller session or call /api/v1/* same-origin.
155
- resHeaders["content-security-policy"] = "sandbox allow-scripts allow-forms";
160
+ // Preview HTML executes under the controller origin (the proxy path);
161
+ // the sandbox CSP was already applied to the shared header object above.
156
162
  resHeaders["content-length"] = String(Buffer.byteLength(rewritten, "utf-8"));
157
163
  res.writeHead(proxyRes.statusCode ?? 200, resHeaders);
158
164
  res.end(rewritten);