mirror of
https://github.com/TriliumNext/Trilium.git
synced 2026-10-12 02:09:59 +00:00
`processContent()` wraps content that holds no tag in a paragraph, and tested for a tag with `/<.+?>/`. CodeQL flags it as a polynomial ReDoS: on a string of `<` with no `>`, each start position scans to the end (1.4 s for 100,000 characters in Node). `/<[^<>]+>/` stops each attempt at the next `<`, so the scan is linear (under 1 ms). The input is the output of `sanitizeHtml()`, which escapes a stray `<` to `<`, so the slow case was most likely unreachable from the route; no spec through `processContent()` can tell the two patterns apart. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>