fix(coding-agent): escape exported image data (#3819)

Fixes #3811
This commit is contained in:
Justin Barnett
2026-04-27 17:22:06 -04:00
committed by GitHub
parent 13610d3893
commit 7617c1ad92
2 changed files with 8 additions and 2 deletions

View File

@@ -25,4 +25,10 @@ describe("export HTML markdown link sanitization", () => {
expect(templateJs).not.toMatch(/\$\{img\.mimeType\}/);
expect(templateJs).toMatch(/escapeHtml\(img\.mimeType/);
});
it("escapes image data attributes", () => {
// Image data is embedded in src attributes and must not allow attribute breakout.
expect(templateJs).not.toMatch(/;base64,\$\{img\.data\}"/);
expect(templateJs).toMatch(/;base64,\$\{escapeHtml\(img\.data \|\| (?:''|"")\)\}"/);
});
});