Skip to content

fix(js): cap fetched_urls to prevent unbounded heap growth - #711

Open
mnaza wants to merge 1 commit into
h4ckf0r0day:mainfrom
mnaza:fix/js-cap-fetched-urls-705
Open

fix(js): cap fetched_urls to prevent unbounded heap growth#711
mnaza wants to merge 1 commit into
h4ckf0r0day:mainfrom
mnaza:fix/js-cap-fetched-urls-705

Conversation

@mnaza

@mnaza mnaza commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Every JS fetch()/XHR appended the request URL to ObscuraState.fetched_urls with no eviction, so a page looping fetch() grew the Vec without bound on the process heap (where V8's heap-limit guard never sees it). Every sibling telemetry collection is already capped; this one was not.

Adds a push_capped front-drain helper (keeps the newest, mirroring js_network_events) and routes the fetched_urls push through it with a 16384-entry cap. fetched_urls only feeds the CLI --dump assets listing, so a bounded most-recent window suffices.

TDD: RED grew to 10, GREEN caps at 4 keeping the newest.

Closes #705

Every JS fetch()/XHR appended the request URL to ObscuraState.fetched_urls
with no eviction, so a page looping fetch() grew the Vec without bound on
the process heap (where V8's heap-limit guard never sees it). Every
sibling telemetry collection in the struct is already capped; this one
was not.

Add a push_capped helper (front-drain, keeping the newest, mirroring the
js_network_events path) and route the fetched_urls push through it with a
16384-entry cap. fetched_urls only feeds the CLI --dump assets listing, so
a bounded most-recent window is sufficient.

Closes h4ckf0r0day#705
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

Successfully merging this pull request may close these issues.

fix(js): fetched_urls grows without bound on repeated fetch()/XHR (DoS)

1 participant