sebastianbergmann/phpunit
Match details
Judged for PHP 8.5.12PCRE2 10.44composer.json config.platform.php · code as of 2026-12-04
build/scripts/phar-manifest.php:666 · preg_match()
663 */664function isPlatformPackage(string $name): bool665{666 return preg_match('^(?:php(?:-64bit-ipv6-zts-debug)?hhvm(?:extlib)-az09(?:_.-?az09+)*composer(?:-(?:pluginruntime)-api)?)$iD', $name) === 1;667}668669function writeDependency(XMLWriter $writer, string $ref, array $dependsOn): void
- FAILAttack: "EXT-0" . "-00" x n . "!" Replayed on PCRE2 10.49: preg_match fails from length 51 (backtrack_limit 100000, JIT off). The risky part is: [a-z0-9]+ Hotspot offsets: 71-80 Unbounded quantifier detected. May cause backtracking on non-matching input. Consider making it possessive (*+) or using atomic groups (?>...). Nested unbounded quantifiers detected. This allows exponential backtracking. Consider using atomic groups (?>...) or possessive quantifiers (*+, ++). Suggested (verify behavior): Consider using possessive quantifiers or atomic groups to limit backtracking. Suggested (verify behavior): Replace inner quantifiers with possessive variants or wrap them in (?>...). Test with adversarial inputs like repeated strings followed by a non-matching character.regex.lint.redos
- WARNConsider atomic groups (?>...) or possessive quantifiers — verify the rewrite still matches everything you need.regex.lint.quantifier.nested
Suggested rewrite, by the optimizer
Witness: "EXT-0" + "-00" × 60 + "!"
Replayed on PCRE2 10.49 (JIT off, backtrack limit 100000): preg_match() gives up from length 51.
Point at a node, or at a piece of the pattern; the arrow keys walk the tree.
Point at a node to read it.
Runs on php-wasm (Apache-2.0) with mbstring and oniguruma (BSD), loaded from jsDelivr when you press Run; PHP 8.6, which php-wasm does not publish yet, is built from its sources and served by this site. The Step through tab traces the match with PCRE2 itself (BSD-3-Clause), the release the chosen PHP bundles, compiled to WebAssembly as PHP bundles it.
1 finding
What the linter reports on the code at the commit named above. A finding opens in the tool.
FAIL
build/scripts/phar-manifest.php:666Replay{^(?:php(?:-64bit|-ipv6|-zts|-debug)?|hhvm|(?:ext|lib)-[a-z0-9](?:[_.-]?[a-z0-9]+)*|composer(?:-(?:plugin|runtime)-api)?)$}iD