Skip to content

Fix out-of-range panic on malformed cookie metadata in extractCookie - #7218

Open
vanshika2720 wants to merge 1 commit into
pipe-cd:masterfrom
vanshika2720:fix/7216-cookie-parsing-panic
Open

Fix out-of-range panic on malformed cookie metadata in extractCookie#7218
vanshika2720 wants to merge 1 commit into
pipe-cd:masterfrom
vanshika2720:fix/7216-cookie-parsing-panic

Conversation

@vanshika2720

Copy link
Copy Markdown
Contributor

Based on that investigation, you can fill the PR template like this:

What this PR does:

Fixes a panic in extractCookie when malformed Cookie metadata contains a segment without =. The change restores the bounds check removed in #6933 and adds a regression test to ensure malformed cookie input is rejected safely instead of causing the control-plane process to panic.

Why we need it:

A malformed Cookie header can currently trigger an index-out-of-range panic before JWT authentication is completed. Since the WebAPI server runs in the same control-plane process as the PipedAPI and APIService, an unrecovered panic can terminate the entire control-plane process.

This is a regression introduced by #6933.

Which issue(s) this PR fixes:

Fixes #7216

Does this PR introduce a user-facing change?:

  • How are users affected by this change: Malformed Cookie metadata is now rejected safely instead of potentially crashing the control-plane process.
  • Is this breaking change: No.
  • How to migrate (if breaking change): Not applicable.

Signed-off-by: Vanshika <pahalvanshikaa@gmail.com>
@vanshika2720
vanshika2720 requested a review from a team as a code owner August 22, 2026 17:16
@netlify

netlify Bot commented Aug 22, 2026

Copy link
Copy Markdown

Deploy Preview for pipecd-site canceled.

Name Link
🔨 Latest commit 5f23337
🔍 Latest deploy log https://app.netlify.com/projects/pipecd-site/deploys/6a89d9683abc7f0008d76f89

@vanshika2720

Copy link
Copy Markdown
Contributor Author

@khanhtc1202 @rahulshendre PTAL!

@rahulshendre rahulshendre added the kind/bug Something isn't working as expected label Aug 22, 2026
@vanshika2720

Copy link
Copy Markdown
Contributor Author

@mohammedfirdouss @rahulshendre PTAL!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/go kind/bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

security: malformed Cookie metadata can panic the control plane

2 participants