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

推荐订阅源

V
V2EX
宝玉的分享
宝玉的分享
Jina AI
Jina AI
IT之家
IT之家
博客园 - Franky
MyScale Blog
MyScale Blog
Y
Y Combinator Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
I
InfoQ
雷峰网
雷峰网
WordPress大学
WordPress大学
Microsoft Security Blog
Microsoft Security Blog
Google DeepMind News
Google DeepMind News
美团技术团队
S
SegmentFault 最新的问题
罗磊的独立博客
博客园 - 聂微东
大猫的无限游戏
大猫的无限游戏
H
Help Net Security
D
Docker
博客园 - 司徒正美
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
阮一峰的网络日志
阮一峰的网络日志
M
MIT News - Artificial intelligence

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(ui): keep local file markdown links inert · openclaw/...
BryanTegomoh · 2026-05-26 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -569,6 +569,20 @@ PY

569569

const html = toSanitizedMarkdownHtml("[click](file:///etc/passwd)");

570570

expect(html).toBe("<p><a>click</a></p>\n");

571571

});

572+
573+

it("strips href from host-local absolute file paths", () => {

574+

const html = toSanitizedMarkdownHtml(

575+

"[report.docx](/Users/test/.openclaw/data/skills/output/report.docx)",

576+

);

577+

expect(html).toBe("<p><a>report.docx</a></p>\n");

578+

});

579+
580+

it("keeps app-relative links navigable", () => {

581+

const html = toSanitizedMarkdownHtml("[usage](/usage)");

582+

expect(html).toBe(

583+

'<p><a href="/usage" rel="noreferrer noopener" target="_blank">usage</a></p>\n',

584+

);

585+

});

572586

});

573587
574588

describe("ReDoS protection", () => {

Original file line numberDiff line numberDiff line change

@@ -84,6 +84,8 @@ const MARKDOWN_PARSE_LIMIT = 40_000;

8484

const MARKDOWN_CACHE_LIMIT = 200;

8585

const MARKDOWN_CACHE_MAX_CHARS = 50_000;

8686

const INLINE_DATA_IMAGE_RE = /^data:image\/[a-z0-9.+-]+;base64,/i;

87+

const HOST_LOCAL_FILE_HREF_RE =

88+

/^(?:~\/|\/(?:Users|home|tmp|private\/tmp|var\/folders|private\/var\/folders)\/|\/[A-Za-z]:\/|[A-Za-z]:[\\/])/;

8789

const markdownCache = new Map<string, string>();

8890

const TAIL_LINK_BLUR_CLASS = "chat-link-tail-blur";

8991

@@ -135,6 +137,10 @@ function shouldRenderCodeBlockCopy(env: unknown): boolean {

135137

return (env as Partial<MarkdownRenderEnv> | undefined)?.codeBlockChrome !== "none";

136138

}

137139
140+

function isHostLocalFileHref(href: string): boolean {

141+

return HOST_LOCAL_FILE_HREF_RE.test(href.trim());

142+

}

143+
138144

function installHooks() {

139145

if (hooksInstalled) {

140146

return;

@@ -150,6 +156,11 @@ function installHooks() {

150156

return;

151157

}

152158
159+

if (isHostLocalFileHref(href)) {

160+

node.removeAttribute("href");

161+

return;

162+

}

163+
153164

// Block dangerous URL schemes (javascript:, data:, vbscript:, etc.)

154165

try {

155166

const url = new URL(href, window.location.href);