Repository navigation
claw2 v0.2.1 — fork & duplicate chats, security remediation pass
Everything below ships in one cut: the fork/duplicate-chats feature and a
security remediation pass (external audit + follow-up code audit).
Added
- Fork and duplicate chats. Two entry points: "Duplicate chat" in the
sidebar chat menu (full copy) and a per-message "Fork from here" button
next to the copy button (branch cut at that message, after a confirm).
The copy carries the history, project, per-chat model and prompt-summary
context; pin/favorite are reset. Generated files stay shared between the
original and its forks (media and documents surface in both), and a
"Forked from chat …" banner above the log opens the original. (web,
gateway, PWA) - Fork tree in the sidebar. Forked chats render nested under their
parent in chain order with a connector line, collapse/expand and a
"forked from …" tooltip; the same tree exists in the mobile client's
chat list. Deleting a chat re-attaches its forks to the parent (graft) —
the chain of reasoning stays connected. - Validating docker API guard (
src/sandbox/docker-guard.ts).
Replaces the generic docker-socket-proxy in the compose delivery: an
endpoint allowlist (container/network lifecycle, image pull, health —
no exec/build/volumes/swarm) plus structural validation of every
container creation — mandatory hardening profile (cap-drop ALL,
no-new-privileges, read-only rootfs), privilege widening rejected,
bind sources restricted to the declared sandbox roots, containers and
networks must be claw2-named, published ports / devices / host
namespaces / restart policies / docker load refused. The guard also
refuses operations targeting its own container. - Hosted (multi-user) isolation. Per-user config is default-deny
filtered (onlyllm/assistant/voice/insightsare
user-settable — sandbox, fs allowlist, skills, channels, gateway policy
stay operator-owned); an emptyskills.allowlistis deny-by-default in
hosted mode; skill authoring (POST /api/agents),/allow, gateway
restart and remote-access control require the new
gateway.auth.adminslist; tenant-overriddenllm.baseURLis
DNS-validated (SSRF gate) and never inherits the operator's API keys. - Per-user file access token.
GET /api/files-tokenissues a
10-minute HMAC token;GET /filesrequires it whenever gateway
authentication is on. This also fixes media (images/audio/video)
failing with 401 under auth-on. Auth-off single-owner setups keep
header-less/filesas before. - Account hardening. Login/token verification enforce account status;
JWTs carry a token version (password change invalidates outstanding
tokens); brute-force limiter on login/register/password-change. - Symlink-safe filesystem layer (
src/security/safe-fs.ts): every
path component is verified (walk + realpath +O_NOFOLLOWopens) for
the fs tools and/filesserving; component identity re-checks detect
mid-operation swaps. Planted symlinks in skill-writable mounts can no
longer redirect reads/writes outside the sandbox roots. - Startup configuration-conflict warnings for the two compose sandbox
conflicts that used to fail silently per skill run:uploads.hostPath
outside the sandbox bind roots, and remoteDOCKER_HOSTwithout
CLAW2_SIBLING_HOST_ROOT.
Changed
- Chat attachment composer accepts up to 10 files (was 20); the
gateway chat body limit is 224 MiB (was 512 MiB). The LLM-room body
parser gained a 2 MiB streaming limit (was unbounded). web_fetchstreams the response with a byte counter and aborts at the
limit instead of buffering the whole body first.- Registration (hosted) mode fails closed when
sessionSecretis
missing or shorter than 32 characters — the JWT gate no longer
silently disappears. GET /api/configtenant responses are policy-filtered and mask
vision.recognizeSecret.
Security
- Method-aware authentication: UI pages are public for GET/HEAD only;
state-changing requests (includingPOST /chat) always require a
verified identity in registration mode./allow(skill approval) and
skill authoring are admin-gated there. - Cross-site guard for auth-off deployments: requests marked cross-site
byOrigin/Sec-Fetch-Siteare refused for state-changing routes
(simpletext/plainbodies used to reach the JSON parser). - Remote-access boundary: the HTTPS proxy stamps a per-process secret;
the companion-auth path requires it, so theX-Claw2-Viaheader cannot
be spoofed through the plain listener. A warning fires when remote
HTTPS is open while the gateway binds non-loopback. - HTML-cell sanitizer hardened: entity/whitespace-encoded
javascript:
schemes (javascript:),data:navigations, CSSurl()/@import
exfiltration and<style>payloads are now stripped (vectors were
model-output injectable; the PWA port already had the fix). - Cross-tenant file surface in hosted mode:
/chat/session-filesis
scoped to the caller's own sessions;/chat/documents,
/chat/assets-summarydisk scans andDELETE /filesrequire an owned
session. web_fetch,web.mdhardening of unbounded reads; raw DB error text
no longer reaches register clients;X-User-Idremoved from CORS
allow-headers; chat titles are capped server-side.
Full Changelog: v0.2.0...v0.2.1