惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
Docker
V
V2EX
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
云风的 BLOG
云风的 BLOG
Blog — PlanetScale
Blog — PlanetScale
Recent Announcements
Recent Announcements
Last Week in AI
Last Week in AI
博客园 - Franky
Microsoft Security Blog
Microsoft Security Blog
Hugging Face - Blog
Hugging Face - Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Vercel News
Vercel News
MyScale Blog
MyScale Blog
大猫的无限游戏
大猫的无限游戏
罗磊的独立博客
H
Help Net Security
月光博客
月光博客
Martin Fowler
Martin Fowler
博客园 - 【当耐特】
宝玉的分享
宝玉的分享
P
Proofpoint News Feed
GbyAI
GbyAI
腾讯CDC
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(canvas): harden asset path resolution · openclaw/open...
vincentkoc · 2026-05-14 · via Recent Commits to openclaw:main

File tree

  • extensions/canvas/src/host

Original file line numberDiff line numberDiff line change

@@ -12,6 +12,7 @@ Docs: https://docs.openclaw.ai

1212

### Fixes

1313
1414

- iOS: restore first-use Contacts, Calendar, and Reminders permission prompts and add Privacy & Access status/actions in Settings. Thanks @BunsDev.

15+

- Canvas: return not found for malformed percent-encoded Canvas/A2UI asset paths and keep decoded parent traversal blocked before path normalization.

1516

- Agents: allow dot-dot-prefixed filenames such as `..note.txt` through sandbox FS bridge, remote sandbox reads, and apply_patch summaries without mistaking the name for parent traversal.

1617

- CLI/migrate: humanize Codex conflict-status messaging across the migrate UI so selection prompts and plan/result rows say "Codex skill already installed in workspace" instead of surfacing internal `MIGRATION_REASON_*` codes. Thanks @sjf.

1718

- CLI/migrate: render migrate result rows with distinct glyphs for manual-review (🔍) and archive (📖) items instead of the misleading "skipped" and "migrated" checkmarks, so users can see which entries still need attention versus which were filed away. Thanks @sjf.

Original file line numberDiff line numberDiff line change

@@ -47,7 +47,15 @@ describe("resolveFileWithinRoot", () => {

4747
4848

it("rejects traversal paths", async () => {

4949

await withCanvasTemp("openclaw-canvas-resolver-", async (root) => {

50+

await fs.writeFile(path.join(root, "outside.txt"), "inside-root", "utf8");

5051

await expect(resolveFileWithinRoot(root, "/../outside.txt")).resolves.toBeNull();

52+

await expect(resolveFileWithinRoot(root, "/%2e%2e%2foutside.txt")).resolves.toBeNull();

53+

});

54+

});

55+
56+

it("rejects malformed URL encoding as a missing file", async () => {

57+

await withCanvasTemp("openclaw-canvas-resolver-", async (root) => {

58+

await expect(resolveFileWithinRoot(root, "/%E0%A4%A")).resolves.toBeNull();

5159

});

5260

});

5361
Original file line numberDiff line numberDiff line change

@@ -9,11 +9,46 @@ export function normalizeUrlPath(rawPath: string): string {

99

return normalized.startsWith("/") ? normalized : `/${normalized}`;

1010

}

1111
12+

function pathEscapesRoot(decodedPath: string): boolean {

13+

let depth = 0;

14+

for (const segment of decodedPath.split("/")) {

15+

if (segment === "" || segment === ".") {

16+

continue;

17+

}

18+

if (segment === "..") {

19+

if (depth === 0) {

20+

return true;

21+

}

22+

depth--;

23+

continue;

24+

}

25+

depth++;

26+

}

27+

return false;

28+

}

29+
30+

function tryNormalizeUrlPath(rawPath: string): string | null {

31+

let decoded: string;

32+

try {

33+

decoded = decodeURIComponent(rawPath || "/");

34+

} catch {

35+

return null;

36+

}

37+

if (pathEscapesRoot(decoded)) {

38+

return null;

39+

}

40+

const normalized = path.posix.normalize(decoded);

41+

return normalized.startsWith("/") ? normalized : `/${normalized}`;

42+

}

43+
1244

export async function resolveFileWithinRoot(

1345

rootReal: string,

1446

urlPath: string,

1547

): Promise<CanvasOpenResult | null> {

16-

const normalized = normalizeUrlPath(urlPath);

48+

const normalized = tryNormalizeUrlPath(urlPath);

49+

if (normalized === null) {

50+

return null;

51+

}

1752

const rel = normalized.replace(/^\/+/, "");

1853

if (rel.split("/").some((p) => p === "..")) {

1954

return null;

Original file line numberDiff line numberDiff line change

@@ -232,6 +232,10 @@ describe("canvas host", () => {

232232

expect(response.body).toContain("v1");

233233

expect(response.body).toContain(CANVAS_WS_PATH);

234234
235+

const malformed = await captureHandlerResponse(handler, `${CANVAS_HOST_PATH}/%E0%A4%A`);

236+

expect(malformed.status).toBe(404);

237+

expect(malformed.body).toBe("not found");

238+
235239

const miss = await captureHandlerResponse(handler, "/");

236240

expect(miss.handled).toBe(false);

237241

@@ -396,6 +400,9 @@ describe("canvas host", () => {

396400

const traversalRes = await captureA2uiResponse(`${A2UI_PATH}/%2e%2e%2fpackage.json`);

397401

expect(traversalRes.status).toBe(404);

398402

expect(traversalRes.body).toBe("not found");

403+

const malformedRes = await captureA2uiResponse(`${A2UI_PATH}/%E0%A4%A`);

404+

expect(malformedRes.status).toBe(404);

405+

expect(malformedRes.body).toBe("not found");

399406

const symlinkRes = await captureA2uiResponse(`${A2UI_PATH}/${linkName}`);

400407

expect(symlinkRes.status).toBe(404);

401408

expect(symlinkRes.body).toBe("not found");