{"record":{"id":"37a6b9366e7fdb8f","repo":"hasura/graphql-engine","slug":"error-in-parsing-the-cookie-header-value-err","errorCode":null,"errorMessage":"Error in parsing the Cookie header value: {err}","messagePattern":"Error in parsing the Cookie header value: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/crates/auth/hasura-authn-jwt/src/jwt.rs","lineNumber":58,"sourceCode":"    ParseClaimsMapEntryError {\n        claim_name: String,\n        err: serde_json::Error,\n    },\n    #[error(\"Expected string value for claim {claim_name}\")]\n    ClaimMustBeAString { claim_name: String },\n    #[error(\"Required claim {claim_name} not found\")]\n    RequiredClaimNotFound { claim_name: String },\n    #[error(\"JWT Authorization token source: Header name {header_name} not found.\")]\n    AuthorizationHeaderSourceNotFound { header_name: String },\n    #[error(\"JWT Authorization token source: Cookie header not found\")]\n    CookieNotFound,\n    #[error(\n        \"JWT Authorization token source: cookie name {cookie_name} not found in the Cookie header\"\n    )]\n    CookieNameNotFound { cookie_name: String },\n    #[error(\"Error in parsing the {header_name} header: {err}\")]\n    AuthorizationHeaderParseError { err: String, header_name: String },\n    #[error(\"Error in parsing the Cookie header value: {err}\")]\n    CookieParseError { err: cookie::ParseError },\n    #[error(\"Missing corresponding value for the cookie with cookie name: {cookie_name}\")]\n    MissingCookieValue { cookie_name: String },\n    #[error(\"JWT validation error: {0}\")]\n    JWTValidationError(jwt::errors::Error),\n    #[error(\"Internal Error - {0}\")]\n    Internal(#[from] InternalError),\n}\n\nimpl TraceableError for Error {\n    fn visibility(&self) -> ErrorVisibility {\n        // For the purpose of traces, all JWT errors should be developer facing.\n        ErrorVisibility::User\n    }\n}\n\n#[derive(Debug, thiserror::Error)]\npub enum InternalError {","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/auth/hasura-authn-jwt/src/jwt.rs#L40-L76","documentation":"The Cookie header value failed to parse per the cookie crate's grammar ({err} is a cookie::ParseError). This means the header is syntactically invalid, not just missing a cookie.","triggerScenarios":"A Cookie header that violates cookie grammar, e.g. unencoded separators/quotes, illegal characters, or malformed name=value pairs.","commonSituations":"Manually constructed Cookie headers in tests/scripts with invalid characters; clients or proxies double-encoding or injecting invalid separators; very old/non-standard cookie values.","solutions":["Inspect {err} for the specific parse failure position","Reproduce with a minimal Cookie header to isolate the offending cookie","Ensure cookie values are set with proper encoding (e.g. URL/base64) and no illegal characters","If a proxy rewrites cookies, bypass or fix its rewriting"],"exampleFix":"// before\nCookie: token=\"abc def\"; other=1\n// after\nCookie: token=abc%20def; other=1","handlingStrategy":"validation","validationCode":"try { parseCookieHeader(req.headers.get('cookie')); } catch (e) { return badRequest('invalid Cookie header'); }","typeGuard":null,"tryCatchPattern":"Catch cookie::ParseError at the edge and reject with 400 before JWT processing; never retry the same header.","preventionTips":["URL-encode cookie values when setting them","Avoid hand-built Cookie header strings in tests"],"tags":["jwt","cookies","parsing","auth"],"backgroundTag":"malformed-cookie-header","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}