The vulnerability exists in the AWS Lambda adapter of the Hono framework, specifically in how it handles responses that contain multiple Set-Cookie headers for AWS Application Load Balancer (ALB) in single-header mode and for AWS VPC Lattice v2. The root cause is the incorrect serialization of multiple cookie strings into a single Set-Cookie header by joining them with a comma. This violates RFC 6265, which mandates that each cookie must be in its own Set-Cookie header. The comma-joining strategy is problematic because the syntax for cookie attributes (e.g., the Expires attribute) can itself contain commas, leading to ambiguity and parsing failures on the client-side.
The analysis of the patch in commit 7ae7cbae5d0ed8a40e8b9cc353e13175b9d7e3e1 clearly identifies the two vulnerable functions. In src/adapter/aws-lambda/handler.ts, both ALBProcessor.setCookiesToResult and LatticeV2Processor.setCookiesToResult contained the flawed cookies.join(', ') logic. The patch corrects this by changing the logic to handle cookies correctly for each specific environment. For ALB in single-header mode, it now sends only the first cookie to prevent creating an invalid header. For Lattice v2, it passes the array of cookies to be processed into multiple headers. An engineer with this CVE in their environment should update to the patched version of Hono to ensure that cookies are set correctly when deploying on the affected AWS services.