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

Debugger opens at runtime #18

Open
radkoff26 opened this issue Feb 28, 2024 · 0 comments
Open

Debugger opens at runtime #18

radkoff26 opened this issue Feb 28, 2024 · 0 comments

Comments

@radkoff26
Copy link

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.

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