fix(security): align audit symlink_escape boundary with skill loader#60513
fix(security): align audit symlink_escape boundary with skill loader#60513menhguin wants to merge 1 commit into
Conversation
The skills.workspace.symlink_escape audit probe checked whether skill file realpaths escaped the workspace root (~/.openclaw/workspace/), but the skill loader (resolveContainedSkillPath) checks against the skills directory root (~/.openclaw/workspace/skills/). This mismatch meant symlinks like: workspace/skills/my-skill -> workspace/other-dir/skills/my-skill ...would resolve inside the workspace root (audit says OK) but outside the skills directory (loader silently rejects). The skill would fail to load with zero feedback from `openclaw security audit`. Fix: check against the skills directory realpath in the audit probe, matching the loader's boundary. Add test for the in-workspace but outside-skills-dir case. Relates to openclaw#49408
Greptile SummaryThis PR fixes a boundary mismatch in Confidence Score: 5/5Safe to merge; the logic fix is correct and well-tested, with only a minor remediation string inconsistency. All remaining findings are P2. The core boundary alignment fix is correct and directly matches the loader's behavior. The new test case validates the previously uncaught scenario. src/security/audit-extra.async.ts line 933 — remediation text should say "skills directory" not "workspace root".
|
|
Closing this as duplicate or superseded after Codex automated review. PR #60513 is a duplicate of the same remaining audit/loader boundary fix already tracked by open PR #60155. Current main still has the mismatch, so this is not implemented, but cleanup should keep one canonical PR rather than two parallel copies of the same fix. Best possible solution: Close #60513 as duplicate/superseded and continue the fix in #60155. The eventual landed change should make the audit check compare against the resolved workspace skills directory, update finding/docs wording from workspace root to skills directory, and add the inside-workspace/outside-skills regression test. What I checked:
So I’m closing this here and keeping the remaining discussion on the canonical linked item. Codex Review notes: model gpt-5.5, reasoning high; reviewed against e29d3516bf05. |
The
skills.workspace.symlink_escapeaudit probe checked whether skillfile realpaths escaped the workspace root (
~/.openclaw/workspace/),but the skill loader (
resolveContainedSkillPath) checks against theskills directory root (
~/.openclaw/workspace/skills/).This mismatch meant symlinks like:
...would resolve inside the workspace root (audit says OK) but outside
the skills directory (loader silently rejects). The skill would fail
to load with zero feedback from
openclaw security audit.Fix: check against the skills directory realpath in the audit probe,
matching the loader's boundary. Add test for the in-workspace but
outside-skills-dir case.
Relates to #49408
Replaces #60144 which had a stale orphan branch causing 11k+ file diff.