CVE-2024-43794: Insecure Url Path Extraction Split

Extracting a URL path by splitting on '?' ignores URL fragments ('#'). This can allow an attacker to bypass prefix-based path validation (e.g., checking if it starts with '/') by hiding payloads in the fragment or using URL-encoded whitespace, leading to vulnerabilities such as Open Redirect or SSRF. Use a robust URL parser (like `new URL()`) or ensure both

Provally CuratedPublic repositoryMediumMedium confidenceVerifiedApache-2.0JS
greprules fetch cve-2024-43794-insecure-url-path-extraction-split --engine opengrep

Description

Extracting a URL path by splitting on '?' ignores URL fragments ('#'). This can allow an attacker to bypass prefix-based path validation (e.g., checking if it starts with '/') by hiding payloads in the fragment or using URL-encoded whitespace, leading to vulnerabilities such as Open Redirect or SSRF. Use a robust URL parser (like `new URL()`) or ensure both