mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-02 18:10:18 +05:30
Follow-up to the push-sweep review: the previous UNSAFE_REGEX used JS bitwise OR (|) between regex literals, accidentally OR-ing the RegExp objects instead of combining alternatives into one pattern. Replace with a single RegExp that catches: - nested quantifiers (a+)+, [a-z]*+ - class + quantifier - dot-quantifier followed by dot-quantifier - lookahead / lookbehind (?=, ?!) - backrefs \1..\9 - alternation + quantifier Also add MAX_REGEX_LENGTH=200 hard cap. The denylist is still defense-in-depth — the length, files-traversed, and per-file-byte caps are the primary defense.