{"record":{"id":"db472085cf23a9d7","repo":"epi052/feroxbuster","slug":"invalid-request-could-not-parse-target-url","errorCode":null,"errorMessage":"Invalid request: Could not parse target URL {}","messagePattern":"Invalid request: Could not parse target URL (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/config/utils.rs","lineNumber":600,"sourceCode":"        config.scope.push(url);\n    } else {\n        // uri in request line is not a valid URL, so it's most likely a path/relative url\n        // we need to combine it with the host header\n        for (key, value) in &config.headers {\n            if key.to_lowercase() == \"host\" {\n                config.target_url = format!(\"{}://{value}{uri}\", config.protocol);\n                break;\n            }\n        }\n\n        if config.target_url.is_empty() {\n            bail!(\"Invalid request: Missing Host header and request line URI isn't a full URL\");\n        }\n\n        if let Ok(url) = parse_url_with_raw_path(&config.target_url) {\n            config.scope.push(url);\n        } else {\n            bail!(\n                \"Invalid request: Could not parse target URL {}\",\n                config.target_url\n            );\n        }\n\n        // need to parse queries from the uri, if any are present\n        let mut uri_parts = uri.splitn(2, '?');\n\n        // skip the path\n        uri_parts.next();\n\n        if let Some(queries) = uri_parts.next() {\n            let query_parts = queries.split(\"&\");\n\n            query_parts.into_iter().for_each(|query| {\n                let Ok((name, value)) = split_query(query) else {\n                    return;\n                };","sourceCodeStart":582,"sourceCodeEnd":618,"githubUrl":"https://github.com/epi052/feroxbuster/blob/1f595dab5c76858d5a14fbc47dabf2563d729c62/src/config/utils.rs#L582-L618","documentation":"Thrown by parse_request_file when the assembled target URL (from Host header + URI or an absolute request URI) cannot be parsed by parse_url_with_raw_path. The URL exists syntactically but is not a valid parseable URL, so the scan scope cannot be established.","triggerScenarios":"target_url built from a malformed Host header (e.g. 'Host: http://weird host' with spaces) or a bogus absolute URI like 'GET htt[p://x' — the URL string is non-empty but unparseable.","commonSituations":"Copy-pasted Host values including protocol or trailing slashes; typos in the scheme of an absolute request URI; control characters or non-ASCII in Host captured from a corrupted request.","solutions":["Inspect the parsed target (the URL is printed in the error) and fix the Host header or absolute URI in the request file","Remove scheme prefixes from the Host header — it should be 'Host: example.com', not 'Host: https://example.com'","URL-encode invalid characters in the path/URI (spaces, quotes, unicode)","Test the URL with a parser (e.g. python -c \"import urlparse...\") before feeding it to the tool"],"exampleFix":"// before\n\"GET / HTTP/1.1\\nHost: https://example.com/path\"\n// after\n\"GET /path HTTP/1.1\\nHost: example.com\"","handlingStrategy":"validation","validationCode":"fn host_header_is_clean(raw: &str) -> Result<(), String> {\n    for line in raw.lines() {\n        if let Some(v) = line.strip_prefix(\"Host:\") {\n            let v = v.trim();\n            if v.contains(' ') || v.starts_with(\"http\") {\n                return Err(format!(\"suspicious Host header value: {v}\"));\n            }\n        }\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the Host header as bare host[:port] with no scheme or path","URL-encode special characters in the request URI","Read the offending URL from the error message and validate it in a URL parser before retrying"],"tags":["http","url","request-parsing"],"backgroundTag":"invalid-url-format","analyzedSha":"1f595dab5c76858d5a14fbc47dabf2563d729c62","analyzedAt":"2026-09-13T19:33:06.208Z","contentChangedAt":"2026-09-13T19:33:06.208Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}