{"record":{"id":"aba2031ca2c1bd48","repo":"kubernetes/kops","slug":"incorrect-authorization-format","errorCode":null,"errorMessage":"incorrect authorization format","messagePattern":"incorrect authorization format","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/bootstrap/awsbootstrap/verifier.go","lineNumber":181,"sourceCode":"\tdecodedHeaders := http.Header(decoded)\n\n\tif decodedHeaders.Get(\"X-Kops-Request-SHA\") != base64.RawStdEncoding.EncodeToString(sha[:]) {\n\t\treturn nil, fmt.Errorf(\"incorrect SHA\")\n\t}\n\n\tauthorization := decodedHeaders.Get(\"Authorization\")\n\tif !strings.HasPrefix(authorization, \"AWS4-HMAC-SHA256 \") {\n\t\treturn nil, fmt.Errorf(\"incorrect authorization algorithm\")\n\t}\n\n\tamzSignature := \"\"\n\tamzCredential := \"\"\n\tamzSignedHeaders := \"\"\n\n\tfor _, token := range strings.Split(strings.TrimPrefix(authorization, \"AWS4-HMAC-SHA256 \"), \", \") {\n\t\tkv := strings.SplitN(token, \"=\", 2)\n\t\tif len(kv) == 1 {\n\t\t\treturn nil, fmt.Errorf(\"incorrect authorization format\")\n\t\t}\n\t\tgot := kv[1]\n\t\tswitch kv[0] {\n\t\tcase \"Signature\":\n\t\t\tamzSignature = got\n\t\tcase \"Credential\":\n\t\t\tamzCredential = got\n\t\tcase \"SignedHeaders\":\n\t\t\tamzSignedHeaders = got\n\t\t}\n\t}\n\tsignedHeaders := sets.New(strings.Split(amzSignedHeaders, \";\")...)\n\tif !signedHeaders.Has(\"x-kops-request-sha\") {\n\t\treturn nil, fmt.Errorf(\"unexpected signed headers value\")\n\t}\n\n\tif amzSignature == \"\" {\n\t\treturn nil, fmt.Errorf(\"unexpected signature value\")","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/bootstrap/awsbootstrap/verifier.go#L163-L199","documentation":"Verification guard in verifyTokenV1: while parsing the comma-separated Authorization header components, a component had no '=' separator, so the Credential/Signature/SignedHeaders values cannot be extracted.","triggerScenarios":"Thrown at pkg/bootstrap/awsbootstrap/verifier.go:181 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the Authorization header uses 'Key=Value' pairs","Regenerate the presigned token","Avoid proxies that mangle authorization headers"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}