DOMPurify - a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks. Demo:
This report summarizes scanner evidence for cure53/DOMPurify, a JavaScript project with 17,499 GitHub stars. SynthScan examined 40,090 lines of code across 95 source files, recording 41 pattern matches distributed across 5 syntactic categories. The legacy adjusted pattern signal is 1.4 (Low pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Payload schema: 1.0.0 · Engine: 2.0.0 · Scoring: heuristic-density-v1 · Scan date: 2026-10-31.
Can maintainers explain intent, assumptions, and trade-offs? 37 finding(s).
Are imports declared and package/API names verified? 2 finding(s).
Are wrappers, guards, and repeated structures necessary? 3 finding(s).
Which changes need focused human review? 41 finding(s).
This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 41 distinct pattern matches across 5 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | osv-scanner.toml | 1 | # OSV-Scanner configuration for DOMPurify | COMMENT |
| LOW | osv-scanner.toml | 21 | # | COMMENT |
| LOW | test/happydom-node.js | 1 | /* jshint node: true, esnext: true */ | COMMENT |
| LOW | test/test-suite.js | 2101 | clobbers | COMMENT |
| LOW | test/test-suite.js | 2381 | // pattern) takes the subtree out of the tree before the walker reaches | COMMENT |
| LOW | test/test-suite.js | 5201 | purify.sanitize('<img src="x" onerror="alert(1)">'), | COMMENT |
| LOW | test/test-suite.js | 5601 | assert.equal( | COMMENT |
| LOW | test/test-suite.js | 5721 | // | COMMENT |
| LOW | test/test-suite.js | 5921 | assert.equal(triggered, false, 'no XSS on native insertion'); | COMMENT |
| LOW | test/test-suite.js | 6201 | // an attack surface. childNodes / nodeType / shadowRoot etc. can be | COMMENT |
| LOW | test/test-suite.js | 6401 | // 1. Engine behaviour: not every name is clobberable via | COMMENT |
| LOW | test/test-suite.js | 6761 | assert.notOk( | COMMENT |
| LOW | test/test-suite.js | 6981 | ); | COMMENT |
| LOW | test/test-suite.js | 7141 | // loop F1, quadratic output F6, re-mirror bypass F3) can only be reproduced | COMMENT |
| LOW | test/test-suite.js | 7361 | ); | COMMENT |
| LOW | test/purify-edge-node.js | 1 | /* jshint node: true, esnext: true */ | COMMENT |
| LOW | test/fuzz/sanitize.fast-check.js | 261 | verbose: true, | COMMENT |
| LOW | test/fuzz/sanitize.fast-check.js | 341 | verbose: true, | COMMENT |
| LOW | test/legacy-playwright/osv-scanner.toml | 1 | # Why this is safe to ignore: dev-only legacy-browser harness, not shipped in the | COMMENT |
| LOW | config/rolldown.coverage.config.js | 1 | // Coverage-only rolldown config. Builds an istanbul-instrumented CJS bundle so | COMMENT |
| LOW | .github/dependabot.yml | 61 | # Legacy-browser harness: intentionally frozen old Playwright builds used | COMMENT |
| LOW | .github/workflows/codeql-analysis.yml | 61 | COMMENT | |
| LOW | .github/workflows/legacy-browsers.yml | 1 | name: Legacy Browsers | COMMENT |
| LOW | .github/workflows/build-and-test-skip.yml | 1 | name: Build & Test | COMMENT |
| LOW | .github/workflows/scorecard.yml | 1 | # This workflow uses actions that are not certified by GitHub. They are provided | COMMENT |
| LOW | .github/workflows/scorecard.yml | 61 | results_file: results.sarif | COMMENT |
| LOW | src/purify.ts | 321 | COMMENT | |
| LOW | src/purify.ts | 1001 | // policy — see #1422). Resetting to `undefined` rather than a sticky | COMMENT |
| LOW | src/purify.ts | 1921 | return ( | COMMENT |
| LOW | src/purify.ts | 1941 | typeof element.removeAttributeNode !== 'function' || | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | osv-scanner.toml | 19 | # The legacy-browser harness pins 1.30-1.50.1 on purpose and keeps its own | COMMENT |
| MEDIUM | test/test-suite.js | 6414 | // failed on some engine. The robust pattern is to ask the | COMMENT |
| MEDIUM | test/legacy-playwright/osv-scanner.toml | 1 | # Why this is safe to ignore: dev-only legacy-browser harness, not shipped in the | COMMENT |
| MEDIUM | test/legacy-playwright/osv-scanner.toml | 4 | # install path this harness uses; `npm ci` runs with --ignore-scripts; the runner | COMMENT |
| MEDIUM | .github/dependabot.yml | 61 | # Legacy-browser harness: intentionally frozen old Playwright builds used | COMMENT |
| MEDIUM | .github/workflows/legacy-browsers.yml | 24 | # Only the lines that carry the Playwright test harness (server.js + | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | .github/dependabot.yml | 76 | # --------------------------------------------------------------------- | COMMENT |
| MEDIUM | .github/dependabot.yml | 85 | # --------------------------------------------------------------------- | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | src/attrs.ts | 80 | 'placeholder', | CODE |
| LOW | src/purify.ts | 649 | 'placeholder', | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | test/bootstrap-test-suite.js | 50 | function loadDOMPurifyWithSanityCheck( | CODE |