Skip to content

Commit 6f17c7e

Browse files
abhizipstackclaude
andauthored
fix: add explicit DOMPurify allowlist for ANSI log rendering (#35)
* fix: add explicit DOMPurify allowlist for ANSI log rendering Restrict allowed tags to span and br, attributes to style only. Tighter than DOMPurify defaults — guards against future version changes while preserving ANSI color spans. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: regenerate package-lock.json to sync with package.json npm ci was failing because lock file was out of sync with dependency versions from recent dependabot merges. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: restore package-lock.json from main Previous regeneration caused version mismatches in CI. This PR only changes a .jsx file — no lock file changes needed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8efcdbf commit 6f17c7e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

frontend/src/ide/editor/no-code-model/no-code-model.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,11 @@ function NoCodeModel({ nodeData }) {
359359
});
360360
updateSpec(newSpec);
361361
};
362-
const parseLog = (log) => DOMPurify.sanitize(ansiToHtml.toHtml(log));
362+
const parseLog = (log) =>
363+
DOMPurify.sanitize(ansiToHtml.toHtml(log), {
364+
ALLOWED_TAGS: ["span", "br"],
365+
ALLOWED_ATTR: ["style"],
366+
});
363367

364368
const hideGenAIAndTimeTravelTabs = true;
365369
const BOTTOM_TABS = [

0 commit comments

Comments
 (0)