Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Debugger opens at runtime #18

Open
Open
@radkoff26

Description

Hi there!
I was trying to fuzz your interesting library as part of my university testing task, when I encountered interesting detail - there is possibility to open debugger at runtime.
I used the following code:

parser = AdvancedHTMLParser.AdvancedHTMLParser()
parser.parseStr(html)
parser.getHTML()

I started fuzzing it. At some point of fuzzing I figured out that program just stopped. At first, I thought it was some infinite cycle case. However, after some research I realized that it was pdb activation which forced program to wait for key input. The following appeared in console:

> /lib/python3.9/site-packages/AdvancedHTMLParser/Tags.py(1531)innerHTML()
-> return ''.join(ret)
(Pdb)

I traced back to the place where pdb was opened and found the following code snippet (Tags.py:1530):

try:
 return ''.join(ret)
except:
 import pdb; pdb.set_trace()
 return ''.join(ret)

This happened when processing of the following input was underway: ",pMêom><`e<adbiT�L".
This case is quite rare, for sure. Although I recommend that you fix it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /