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

推荐订阅源

IT之家
IT之家
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
大猫的无限游戏
大猫的无限游戏
美团技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园_首页
MyScale Blog
MyScale Blog
N
Netflix TechBlog - Medium
I
InfoQ
Jina AI
Jina AI
Martin Fowler
Martin Fowler
Recent Announcements
Recent Announcements
量子位
月光博客
月光博客
罗磊的独立博客
雷峰网
雷峰网
The Cloudflare Blog
V
V2EX
小众软件
小众软件
人人都是产品经理
人人都是产品经理
博客园 - Franky
T
Tailwind CSS Blog
有赞技术团队
有赞技术团队
S
SegmentFault 最新的问题

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
Harden exported markdown link rendering [AI] (#80902) · o...
pgondhi987 · 2026-05-12 · via Recent Commits to openclaw:main

@@ -414,10 +414,90 @@ describe("export html security hardening", () => {

414414

requireElement(messages.querySelector(`img[src="${dataImage}"]`), "data markdown image missing");

415415

});

416416417+

it("flattens unsafe markdown links while preserving safe links", async () => {

418+

const session: SessionData = {

419+

header: { id: "session-5", timestamp: now() },

420+

entries: [

421+

{

422+

id: "1",

423+

parentId: null,

424+

timestamp: now(),

425+

type: "message",

426+

message: {

427+

role: "user",

428+

content: [

429+

"[script](javascript:alert(1))",

430+

"[encoded](javascript:alert(2))",

431+

"[split](java	script:alert(3))",

432+

"[zero-width](java​script:alert(4))",

433+

"[surrogate](java�script:alert(5))",

434+

'[safe](https://example.com/report "report")',

435+

].join("\n"),

436+

},

437+

},

438+

{

439+

id: "2",

440+

parentId: "1",

441+

timestamp: now(),

442+

type: "message",

443+

message: {

444+

role: "assistant",

445+

content: [

446+

{

447+

type: "text",

448+

text: "[data](data:text/html;base64,PGgxPnBvYzwvaDE+) [mail](mailto:test@example.com)",

449+

},

450+

],

451+

},

452+

},

453+

{

454+

id: "3",

455+

parentId: "2",

456+

timestamp: now(),

457+

type: "branch_summary",

458+

summary: "[relative](./notes.md)",

459+

},

460+

{

461+

id: "4",

462+

parentId: "3",

463+

timestamp: now(),

464+

type: "custom_message",

465+

customType: "x",

466+

display: true,

467+

content: "[hash](#entry-1)",

468+

},

469+

],

470+

leafId: "4",

471+

systemPrompt: "",

472+

tools: [],

473+

};

474+475+

const { document } = await renderTemplate(session);

476+

const messages = requireElement(document.getElementById("messages"), "messages root missing");

477+

const hrefs = Array.from(messages.querySelectorAll("a"), (link) => link.getAttribute("href"));

478+479+

expect(hrefs).toEqual([

480+

"https://example.com/report",

481+

"mailto:test@example.com",

482+

"./notes.md",

483+

"#entry-1",

484+

]);

485+

expect(messages.querySelector("a")?.getAttribute("title")).toBe("report");

486+

expect(messages.textContent).toContain("script");

487+

expect(messages.textContent).toContain("encoded");

488+

expect(messages.textContent).toContain("split");

489+

expect(messages.textContent).toContain("zero-width");

490+

expect(messages.textContent).toContain("surrogate");

491+

expect(messages.textContent).toContain("data");

492+

expect(hrefs.some((href) => href?.startsWith("javascript:") || href?.startsWith("data:"))).toBe(

493+

false,

494+

);

495+

});

496+417497

it("escapes markdown data-image attributes", async () => {

418498

const dataImage = "data:image/png;base64,AAAA";

419499

const session: SessionData = {

420-

header: { id: "session-5", timestamp: now() },

500+

header: { id: "session-6", timestamp: now() },

421501

entries: [

422502

{

423503

id: "1",