CVE-2026-47676: Unsafe Url Pathname Slice

Directly slicing `url.pathname` with a dynamically calculated index length can result in arbitrary path truncation when requests contain percent-encoded multibyte characters. Because multi-byte characters require more string characters when percent-encoded, a length calculated from a decoded representation will misalign with the encoded representation, causi

Provally CuratedPublic repositoryMediumMedium confidenceVerifiedApache-2.0JS
greprules fetch cve-2026-47676-unsafe-url-pathname-slice --engine opengrep

Description

Directly slicing `url.pathname` with a dynamically calculated index length can result in arbitrary path truncation when requests contain percent-encoded multibyte characters. Because multi-byte characters require more string characters when percent-encoded, a length calculated from a decoded representation will misalign with the encoded representation, causi