Skip to content

v0.5.2 — eliminate the slug-trim ReDoS

Choose a tag to compare

@scttbnsn scttbnsn released this 30 Jun 23:32

A security patch. The slugify idiom .replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") had a polynomial-ReDoS in the trailing -+$ (O(n²) backtracking). CodeQL flagged two reachable sites; this fixes the whole class — 15 sites across providers, tracker, profile, comms, research, interview, and a script. The preceding collapse makes boundary dashes single, so /^-|-$/g is equivalent and quantifier-free.

rolester update    # or: npm i -g rolester@0.5.2