Skip to content

After updating httpx to the latest version, I’m consistently seeing a panic when httpx tries to classify certain HTML pages (likely deeply nested or malformed HTML). #2316

Closed

Description

@exf1-l

Panic message:

panic: html: open stack of elements exceeds 512 nodes

Stack trace (from httpx):
github.com/projectdiscovery/httpx/common/pagetypeclassifier.htmlToText
github.com/projectdiscovery/httpx/common/pagetypeclassifier.(*PageTypeClassifier).Classify
github.com/projectdiscovery/httpx/runner.(*Runner).analyze
github.com/projectdiscovery/httpx/runner.(*Runner).process.func1
...

I am unsure of what triggered this but basically I was using httpx like this:
"cat hosts.txt| httpx -cl -sc -title -td -ct -server -vhost -o httpx-out.txt",

Now I have updated httpx on my 2 vps machine and both when doing this exhaustive lists of hosts, errored out like this so I do not know the actual url's that triggered this error. But in my localmachine where my httpx is still the older version, it worked completely fine.

I believe there is an issue in this new update, I am very bad at this hence I am really sorry if i have wasted your time in creating this issue if it is not legitimate, but this is what I noticed like after using httpx today morning and after updating it to the latest version.

Image

Activity

  1. added
    Type: Bug
    on Nov 20, 2025
  2. self-assigned this
    on Nov 20, 2025
  3. seeblog commented on Nov 24, 2025

    @seeblog

    I encountered the same problem.

    panic: html: open stack of elements exceeds 512 nodes

    goroutine 54004 [running]:
    github.com/projectdiscovery/httpx/common/pagetypeclassifier.htmlToText(...)
    /home/runner/work/httpx/httpx/common/pagetypeclassifier/pagetypeclassifier.go:36
    github.com/projectdiscovery/httpx/common/pagetypeclassifier.(*PageTypeClassifier).Classify(0xc000110978, {0xc0075f0000?, 0xc?})
    /home/runner/work/httpx/httpx/common/pagetypeclassifier/pagetypeclassifier.go:26 +0x6f
    github.com/projectdiscovery/httpx/runner.(*Runner).analyze(_, , {, _}, {{0xc0035cbcf8, 0x16}, {0x0, 0x0}, {0x0, 0x0}}, ...)
    /home/runner/work/httpx/httpx/runner/runner.go:2349 +0x7555
    github.com/projectdiscovery/httpx/runner.(*Runner).process.func1({{0xc0035cbcf8, 0x16}, {0x0, 0x0}, {0x0, 0x0}}, {0x1686161?, 0x0?}, {0x16ace2d, 0xa})
    /home/runner/work/httpx/httpx/runner/runner.go:1444 +0x125
    created by github.com/projectdiscovery/httpx/runner.(*Runner).process in goroutine 1
    /home/runner/work/httpx/httpx/runner/runner.go:1442 +0x8a6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type: Bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions