[wp-trac] [WordPress Trac] #61810: HTML API: Parser may hang on some unclosed script tag inputs

WordPress Trac noreply at wordpress.org
Fri Aug 2 15:14:02 UTC 2024


#61810: HTML API: Parser may hang on some unclosed script tag inputs
--------------------------+------------------------
 Reporter:  jonsurrell    |      Owner:  jonsurrell
     Type:  defect (bug)  |     Status:  assigned
 Priority:  normal        |  Milestone:  6.6.2
Component:  HTML API      |    Version:  6.5
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+------------------------
 When the Tag Processor (or HTML Processor) attempts to parse certain
 incomplete script tags, the parser enters an infinite loop and will hang
 indefinitely. The conditions to reach this situation are:

 - Input HTML ends with an open script tag.
 - The final character of input is `-` or `<`.

 If these conditions are satisfied, the parser will enter an infinite loop
 and hang when it attempts to parse the script tag.

 Example problematic inputs:
 - `<script>-`
 - `<script><`

 Creating a processor and calling `next_tag()` will hang. In both cases,
 `next_tag()` should return false with the processor in incomplete token
 state.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61810>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list