Skip to content

html: open stack of elements exceeds 512 nodes #2329

Closed

Description

@alonek1

httpx crashes with a Go HTML parser panic when scanning a specific URL.
The crash occurs inside the PageTypeClassifier (htmlToText) when encountering deeply nested or minified HTML-like content (in this case, a large JS file).
url causing the panic:

url

command used

echo  https://unpkg.com/[email protected]/build/three.min.js | httpx  -title -tech-detect -status-code -location -content-length -cname -web-server -follow-redirects -websocket

Panic Output

panic: html: open stack of elements exceeds 512 nodes

goroutine 3033 [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(0xc0096fb488, {0xc00f0d6000?, 0xc?})
        /home/runner/work/httpx/httpx/common/pagetypeclassifier/pagetypeclassifier.go:26 +0x6f
github.com/projectdiscovery/httpx/runner.(*Runner).analyze(_, _, {_, _}, {{0xc00b60e200, 0x32}, {0x0, 0x0}, {0x0, 0x0}}, ...)
        /home/runner/work/httpx/httpx/runner/runner.go:2349 +0x7555
github.com/projectdiscovery/httpx/runner.(*Runner).process.func1({{0xc00b60e200, 0x32}, {0x0, 0x0}, {0x0, 0x0}}, {0x1686161?, 0x0?}, {0xc00b60e200, 0x5})
        /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

Activity

  1. added
    Type: Bug
    on Dec 6, 2025
  2. ehsandeep commented on Dec 6, 2025

    @ehsandeep
    Member

    @alonek1 fixed in #2330, will be included in next release.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: Bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions