Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite loop on malformed input #182

Open
nikic opened this issue Dec 25, 2019 · 0 comments
Open

Infinite loop on malformed input #182

nikic opened this issue Dec 25, 2019 · 0 comments

Comments

@nikic
Copy link

nikic commented Dec 25, 2019

When trying to parse the input P{P:[, the parser goes into an infinite loop.

Backtrace snapshot:

#1 /home/nikic/PHP-Fuzzer/example/PHP-CSS-Parser/lib/Sabberworm/CSS/Parsing/ParserState.php(52): Sabberworm\CSS\Parsing\ParserState->parseCharacter(true)
#2 /home/nikic/PHP-Fuzzer/example/PHP-CSS-Parser/lib/Sabberworm/CSS/Value/LineName.php(20): Sabberworm\CSS\Parsing\ParserState->parseIdentifier()
#3 /home/nikic/PHP-Fuzzer/example/PHP-CSS-Parser/lib/Sabberworm/CSS/Value/Value.php(94): Sabberworm\CSS\Value\LineName::parse(Object(Sabberworm\CSS\Parsing\ParserState))
#4 /home/nikic/PHP-Fuzzer/example/PHP-CSS-Parser/lib/Sabberworm/CSS/Value/Value.php(36): Sabberworm\CSS\Value\Value::parsePrimitiveValue(Object(Sabberworm\CSS\Parsing\ParserState))
#5 /home/nikic/PHP-Fuzzer/example/PHP-CSS-Parser/lib/Sabberworm/CSS/Rule/Rule.php(39): Sabberworm\CSS\Value\Value::parseValue(Object(Sabberworm\CSS\Parsing\ParserState), Array)
#6 /home/nikic/PHP-Fuzzer/example/PHP-CSS-Parser/lib/Sabberworm/CSS/RuleSet/RuleSet.php(35): Sabberworm\CSS\Rule\Rule::parse(Object(Sabberworm\CSS\Parsing\ParserState))
#7 /home/nikic/PHP-Fuzzer/example/PHP-CSS-Parser/lib/Sabberworm/CSS/RuleSet/DeclarationBlock.php(62): Sabberworm\CSS\RuleSet\RuleSet::parseRuleSet(Object(Sabberworm\CSS\Parsing\ParserState), Object(Sabberworm\CSS\RuleSet\DeclarationBlock))
#8 /home/nikic/PHP-Fuzzer/example/PHP-CSS-Parser/lib/Sabberworm/CSS/CSSList/CSSList.php(101): Sabberworm\CSS\RuleSet\DeclarationBlock::parse(Object(Sabberworm\CSS\Parsing\ParserState), Object(Sabberworm\CSS\CSSList\Document))
#9 /home/nikic/PHP-Fuzzer/example/PHP-CSS-Parser/lib/Sabberworm/CSS/CSSList/CSSList.php(50): Sabberworm\CSS\CSSList\CSSList::parseListItem(Object(Sabberworm\CSS\Parsing\ParserState), Object(Sabberworm\CSS\CSSList\Document))
#10 /home/nikic/PHP-Fuzzer/example/PHP-CSS-Parser/lib/Sabberworm/CSS/CSSList/Document.php(21): Sabberworm\CSS\CSSList\CSSList::parseList(Object(Sabberworm\CSS\Parsing\ParserState), Object(Sabberworm\CSS\CSSList\Document))
#11 /home/nikic/PHP-Fuzzer/example/PHP-CSS-Parser/lib/Sabberworm/CSS/Parser.php(38): Sabberworm\CSS\CSSList\Document::parse(Object(Sabberworm\CSS\Parsing\ParserState))
#12 /home/nikic/PHP-Fuzzer/example/target_css_parser.php(9): Sabberworm\CSS\Parser->parse()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant