{"record":{"id":"891742f747ca4c44","repo":"projectdiscovery/nuclei","slug":"malformed-request-supplied","errorCode":null,"errorMessage":"malformed request supplied","messagePattern":"malformed request supplied","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/protocols/http/build_request.go","lineNumber":342,"sourceCode":"\t// If the request is a raw request, get the URL from the request\n\t// header and use it to make the request.\n\tif isRawRequest {\n\t\t// Get the hostname from the URL section to build the request.\n\t\treader := bufio.NewReader(strings.NewReader(data))\n\tread_line:\n\t\ts, err := reader.ReadString('\\n')\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"could not read request: %w\", err)\n\t\t}\n\n\t\t// ignore all annotations\n\t\tif stringsutil.HasPrefixAny(s, \"@\") {\n\t\t\tgoto read_line\n\t\t}\n\n\t\tparts := strings.Split(s, \" \")\n\t\tif len(parts) < 3 {\n\t\t\treturn nil, fmt.Errorf(\"malformed request supplied\")\n\t\t}\n\n\t\tif err := expressions.ContainsUnresolvedVariables(parts[1]); err != nil && !r.request.SkipVariablesCheck {\n\t\t\treturn nil, errkit.Newf(\"unresolved variables `%v` found in request\", parts[1])\n\t\t}\n\n\t\tparsed, err := urlutil.ParseURL(parts[1], true)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"could not parse request URL: %w\", err)\n\t\t}\n\t\t// self-contained requests choose their own destination URL, so validate\n\t\t// that host against the network policy.\n\t\tif err := r.validateSelfContainedHost(parsed.Hostname()); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tvalues = generators.MergeMaps(\n\t\t\tgenerators.MergeMaps(dynamicValues, protocolutils.GenerateVariables(parsed, false, nil)),\n\t\t\tvalues,","sourceCodeStart":324,"sourceCodeEnd":360,"githubUrl":"https://github.com/projectdiscovery/nuclei/blob/265b3a3dec374741614e342f813c10f8b38d2bb7/pkg/protocols/http/build_request.go#L324-L360","documentation":"Error \"malformed request supplied\" thrown in projectdiscovery/nuclei.","triggerScenarios":"Thrown at pkg/protocols/http/build_request.go:342 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"265b3a3dec374741614e342f813c10f8b38d2bb7","analyzedAt":"2026-08-15T20:05:51.855Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}