This regex is used to process user-provided data in SubmitForm's replaceFormula: /<\s*([^<>]+)\s*>/ . It is vulnerable to a Regular Expression Denial-of-Service attack as it is an expression of third degree polynomial complexity.
In addition, /\s*,\s*/, a polynomial of second degree complexity is used in these files:
- Map result printer
- Database result printer (also used in this line)
- rebuildData maintenance script but it's trusted input in this context
- Importer; should this be trusted, @Thomas-topway-it?
- Query processor
- Parser function (also used here)
The query processor also uses many inefficient regexes:
- /\[\[(.+?)\]\]/ (2nd degree)
- /^\s*(.+?)\s*(ASC|DESC)?\s*$/i (4th degree)
- Several other 2nd degree polynomials
- Several 5th degree polynomials
More inefficient regexes:
- /^(\d+)(.+)?$/ (2nd degree), used in the Carousel result printer but is this actually an issue, @Thomas-topway-it?
- /^\*\s*([^\*].*)$/ (2nd degree), used by the schema processor
- /^preload-data(\?(.+?))?=(.+)$/ (2nd degree), used by the parser function
- /\s*\|\+\s*/ (2nd degree), used by the parser function
- Also this 'separator' regex
Affilation: Miraheze/WikiTide Foundation security reviewer
(Branched off from T385935 per @sbassett's instruction)