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

Quadratic behavior with inline HTML #379

Closed
nwellnhof opened this issue Mar 22, 2021 · 1 comment
Closed

Quadratic behavior with inline HTML #379

nwellnhof opened this issue Mar 22, 2021 · 1 comment

Comments

@nwellnhof
Copy link
Contributor

Parsing a sequence of certain HTML opening constructs results in quadratic behavior:

# Processing instruction
python3 -c 'print("a"+"<?"*50000)' |build/src/cmark >/dev/null
# Declaration
python3 -c 'print("a"+"<!D "*50000)' |build/src/cmark >/dev/null
# CDATA section
python3 -c 'print("a"+"<![CDATA["*50000)' |build/src/cmark >/dev/null

Possible fix: Don't try to reparse these constructs if the (fixed) character sequence required to terminate them wasn't found during the first scan.

Found by OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32344

@nwellnhof
Copy link
Contributor Author

Oops, this was already reported as #299.

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