openclaw/extensions
Viz f624b1d246
fix(security): 7 P1 hardening fixes — scan-paths, windows-acl, audit-extra (#67003)
* test(security): add coverage tests before security fixes

- scan-paths.ts: 100% line coverage (new test file, previously zero)
- windows-acl.ts: 100% line coverage (SID bypass, whoami throw, no-user null return)
- external-content.ts: 99% (line 248 defensive overlap guard, unreachable)
- skill-scanner.ts: 93% (lines 293-294/330/571 are defensive guards for
  future extensibility, unreachable with current rules/patterns)

200+ tests covering TOCTOU paths, cache invalidation, forced-file escapes,
dir-entry-cache hit, SID world-bypass, diacritic-strip fallback,
fullwidth homoglyph markers, and more.

* fix(security): 5 security hardening fixes in src/security/

scan-paths: default requireRealpath to false (safe). All production callers
already pass requireRealpath: true; default callers are now secure.

windows-acl: block world-equivalent SIDs (S-1-1-0 Everyone etc.) from being
added to trusted set via USERSID env var.

windows-acl: log resolveCurrentUserSid failures instead of bare catch{}.

audit-extra: wrap JSON.parse in readPluginManifestExtensions with try-catch.
Malformed package.json returns [] instead of crashing the audit.

audit-extra: depth guard in listWorkspaceSkillMarkdownFiles to prevent
resource exhaustion from deep symlink cycles.

audit-extra: 2s timeout on fs.realpath in collectWorkspaceSkillSymlinkEscapeFindings
to protect against hanging on slow/network filesystems.

audit-extra: warn about phantom entries in plugins.allow that don't match
any installed plugin (pre-approval exploitation vector).

media-understanding/types: add allowPrivateNetwork to transport overrides
(duplicate of PR #66967, required for tsgo to pass here).

* fix(security): address security review findings in audit-extra.async.ts

Issue 1 — Symlink escape audit bypass on realpath timeout:
When realpathWithTimeout returns null (timeout or failure), the previous code
called 'continue', silently skipping the escape check. An attacker with a
symlink to a slow/network filesystem could hang realpath to prevent escape
detection. Now treats unverifiable symlinks as potential escapes and includes
them in the finding.

Issue 2 — Malformed package.json hides extension entrypoints from deep scan:
readPluginManifestExtensions previously swallowed JSON.parse errors and
returned [], which a malicious plugin could exploit by crafting a malformed
package.json to hide its openclaw.extensions entrypoints from the deep code
scanner. Now re-throws the parse error (with cause) so the caller in
collectPluginsCodeSafetyFindings can surface a warn finding and alert the
user, while still scanning the plugin directory via getCodeSafetySummary.

* fix(security): address PR review findings (P1 + P2)

P1 — BFS realpath in listWorkspaceSkillMarkdownFiles lacks timeout:
Extract realpathWithTimeout to module scope so the BFS dequeue loop
uses the same 2 s guard as the outer escape-detection callers. Previously
only the per-workspace and per-skill-file realpaths had the timeout;
a hanging NFS/SMB directory entry inside the BFS could still block
indefinitely.

P1 (acknowledged limitation) — Promise.race leaves the underlying
fs.realpath call running after timeout. fs.realpath cannot be cancelled
once submitted to libuv. Callers are sequential (one await at a time),
so at most one worker thread is occupied; the OS will eventually time
out the stuck call. This is documented in the module-level JSDoc.

P2 — Phantom allowlist check incorrectly flags bundled plugin IDs:
listChannelPlugins() returns bundled channel plugin IDs (telegram,
discord, browser, etc.) that are never in stateDir/extensions.
Add bundledPluginIds exclusion so the phantom-entry finding is scoped
to user-installed extension IDs only.

P2 — Rename MAX_SYMLINK_DEPTH / depthGuard to MAX_TOTAL_DIR_VISITS /
totalDirVisits to accurately reflect that the guard caps total BFS
iterations (2_000 * 20 = 40_000), not per-path symlink depth.

* fix(security): clean up realpathWithTimeout timer and add regression tests

- Clear the timer handle when fs.realpath resolves before the deadline,
  preventing timer accumulation during large audit runs with many files.
- Add .unref() on the timer so it cannot hold the process alive while
  waiting on a potentially hanging NFS/SMB path.

Regression tests added for three audit-extra.async security fixes:
- manifest parse error: malformed plugin package.json surfaces
  plugins.code_safety.manifest_parse_error (audit-extra.async.test.ts)
- phantom allowlist with bundled exclusion: bundled channel plugin IDs
  are excluded from plugins.allow_phantom_entries warnings; non-installed
  non-bundled IDs are correctly reported (audit-plugins-phantom.test.ts)
- unverifiable realpath escape: fs.realpath failure / timeout produces a
  skills.workspace.symlink_escape finding with 'realpath timed out' in
  the detail (audit-workspace-skill-escape.test.ts)

* chore(security): add TODO for structured logger in windows-acl resolveCurrentUserSid

console.warn is acceptable short-term but may be noisy on constrained
Windows hosts; note the follow-up in-code so it is not lost.

* chore: drop unrelated formatting churn from security PR

Restores extensions/memory-lancedb/config.ts and
src/agents/pi-embedded-helpers/errors.ts to their origin/main state.
These were line-wrap-only formatting changes with no relation to the
security fixes in this branch.

* fix(security): address Codex P2 review findings

1. Normalize plugins.allow entries through normalizePluginId before
   phantom-entry filtering so that bundled plugin aliases and legacy IDs
   are correctly excluded. Without this, valid allow entries that resolve
   via alias normalization could generate false-positive phantom warnings.

2. Surface a skills.workspace.scan_truncated warn finding when the BFS
   visit cap (MAX_TOTAL_DIR_VISITS) is hit mid-traversal. Previously the
   scanner silently returned partial results, allowing escaped SKILL.md
   symlinks in the unvisited tree to go undetected.

   listWorkspaceSkillMarkdownFiles now returns {skillFilePaths, truncated}
   and collectWorkspaceSkillSymlinkEscapeFindings emits the new finding
   when truncated is true.

Regression test added for the truncation path using a mocked readdir
that fills the queue past the cap (40 001 fake entries) and a mocked
realpath for zero-I/O iteration speed.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-04-16 13:40:05 -04:00
..
acpx build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
active-memory fix(active-memory): Move active memory recall into the hidden prompt prefix (#66144) 2026-04-13 16:05:43 -05:00
alibaba build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
amazon-bedrock build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
amazon-bedrock-mantle build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
anthropic feat: default Anthropic to Opus 4.7 2026-04-16 16:12:06 +01:00
anthropic-vertex build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
arcee build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
bluebubbles fix(bluebubbles): restore inbound image attachments and accept updated-message events (#67510) 2026-04-16 10:04:20 -07:00
brave build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
browser fix(context-window): Tighten context limits and bound memory excerpts (#67277) 2026-04-15 13:06:02 -05:00
byteplus build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
chutes build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
cloudflare-ai-gateway build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
codex fix(codex): activate harness plugin for forced runtime 2026-04-16 09:06:45 -07:00
comfy build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
copilot-proxy build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
deepgram build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
deepseek build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
device-pair fix: disambiguate device-pair notify subscribers 2026-04-10 19:46:23 -05:00
diagnostics-otel build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
diffs build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
discord test: keep discord channel actions on public test SDK 2026-04-16 10:28:22 -07:00
duckduckgo build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
elevenlabs fix: register bundled TTS providers and route overrides correctly (#62846) (thanks @stainlu) 2026-04-16 15:26:38 +05:30
exa build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
fal build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
feishu fix(plugins): stabilize bundled setup runtimes (#67200) 2026-04-15 12:35:18 -04:00
firecrawl build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
fireworks build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
github-copilot build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
google fix: add Google Gemini TTS provider (#67515) (thanks @barronlroth) 2026-04-16 11:54:35 +05:30
googlechat fix(plugins): stabilize bundled setup runtimes (#67200) 2026-04-15 12:35:18 -04:00
groq build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
huggingface build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
image-generation-core build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
imessage fix(plugins): stabilize bundled setup runtimes (#67200) 2026-04-15 12:35:18 -04:00
irc fix(plugins): stabilize bundled setup runtimes (#67200) 2026-04-15 12:35:18 -04:00
kilocode build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
kimi-coding build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
line fix(plugins): stabilize bundled setup runtimes (#67200) 2026-04-15 12:35:18 -04:00
litellm build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
llm-task build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
lmstudio Extensions/lmstudio: back off inference preload after consecutive failures 2026-04-16 18:31:56 +05:30
lobster build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
matrix fix(matrix): skip pairing-store reads for room auth (#67325) 2026-04-15 14:08:43 -04:00
mattermost fix(plugins): stabilize bundled setup runtimes (#67200) 2026-04-15 12:35:18 -04:00
media-understanding-core build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
memory-core fix(dreaming): default storage.mode to "separate" so phase blocks stop polluting daily memory files (#66412) 2026-04-15 13:49:18 -07:00
memory-lancedb fix(security): 7 P1 hardening fixes — scan-paths, windows-acl, audit-extra (#67003) 2026-04-16 13:40:05 -04:00
memory-wiki build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
microsoft fix: register bundled TTS providers and route overrides correctly (#62846) (thanks @stainlu) 2026-04-16 15:26:38 +05:30
microsoft-foundry build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
minimax build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
mistral build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
moonshot build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
msteams fix(msteams): harden security-sensitive flows (#65841) 2026-04-15 22:30:23 -05:00
nextcloud-talk fix(plugins): stabilize bundled setup runtimes (#67200) 2026-04-15 12:35:18 -04:00
nostr fix(plugins): stabilize bundled setup runtimes (#67200) 2026-04-15 12:35:18 -04:00
nvidia build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
ollama fix: restore Ollama chat model IDs (#67457) (thanks @suboss87) 2026-04-16 11:15:37 +05:30
open-prose build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
openai fix: pin codex resume sandbox override 2026-04-16 17:31:41 +01:00
opencode build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
opencode-go build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
openrouter build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
openshell build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
perplexity build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
phone-control test: remove redundant phone control conversions 2026-04-10 21:55:28 +01:00
qa-channel QA: fix private runtime source loading (#67428) 2026-04-15 21:59:16 -04:00
qa-lab QA: split lab runtime and extend Matrix coverage (#67430) 2026-04-16 03:08:39 -04:00
qa-matrix QA: split lab runtime and extend Matrix coverage (#67430) 2026-04-16 03:08:39 -04:00
qianfan build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
qqbot fix(plugins): stabilize bundled setup runtimes (#67200) 2026-04-15 12:35:18 -04:00
qwen build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
runway build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
searxng build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
sglang build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
shared
signal fix(plugins): stabilize bundled setup runtimes (#67200) 2026-04-15 12:35:18 -04:00
slack fix(plugins): stabilize bundled setup runtimes (#67200) 2026-04-15 12:35:18 -04:00
speech-core fix: register bundled TTS providers and route overrides correctly (#62846) (thanks @stainlu) 2026-04-16 15:26:38 +05:30
stepfun build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
synology-chat fix(plugins): stabilize bundled setup runtimes (#67200) 2026-04-15 12:35:18 -04:00
synthetic build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
talk-voice chore: enable no-floating-promises 2026-04-10 20:14:49 +01:00
tavily build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
telegram fix(plugins): stabilize bundled setup runtimes (#67200) 2026-04-15 12:35:18 -04:00
thread-ownership refactor: simplify extension conversions 2026-04-11 01:37:23 +01:00
tlon fix(plugins): stabilize bundled setup runtimes (#67200) 2026-04-15 12:35:18 -04:00
together build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
twitch fix(plugins): stabilize bundled setup runtimes (#67200) 2026-04-15 12:35:18 -04:00
venice build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
vercel-ai-gateway build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
video-generation-core build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
vllm build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
voice-call build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
volcengine build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
vydra build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
webhooks build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
whatsapp fix(whatsapp): write creds.json atomically (#63577) 2026-04-16 02:44:46 -03:00
xai build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
xiaomi build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
zai build(extensions): bump bundled plugin versions to 2026.4.15-beta.1 2026-04-15 15:06:13 +01:00
zalo fix(plugins): stabilize bundled setup runtimes (#67200) 2026-04-15 12:35:18 -04:00
zalouser fix(plugins): stabilize bundled setup runtimes (#67200) 2026-04-15 12:35:18 -04:00
.npmignore
AGENTS.md docs(agents): split scoped workflow guidance (#65241) 2026-04-12 09:09:50 +01:00
CLAUDE.md
music-generation-providers.live.test.ts fix: stabilize media live provider coverage 2026-04-06 19:15:31 +01:00
tsconfig.package-boundary.base.json refactor(cli): normalize route boundaries 2026-04-06 15:38:04 +01:00
tsconfig.package-boundary.paths.json fix(ci): sync package boundary paths config 2026-04-09 23:59:00 +01:00
video-generation-providers.live.test.ts fix: bound live video generation smoke 2026-04-14 14:59:01 +01:00