envoyproxy/envoy

Stateful Session cookies incompatible between Envoy Processes.

クローズ

#44,111 opened on 2026/03/25

 (1 件のコメント) (0 件のリアクション) (1 人の担当者)C++ (5,373 件のフォーク)batch import
bughelp wanted

Repository metrics

Stars
 (27,997 個のスター)
PR merge metrics
 (平均マージ 8d) (30d で 378 merged PRs)

説明

Title: Stateful Session cookies incompatible between Envoy Processes.

Description: When using Envoy as an Edge Proxy with multiple instances (an NLB in front) AND using the StatefulSession with cookies doesn't work properly.

The cookie is encoded with the expiry time BUT it uses the monotonic clock:

https://github.com/envoyproxy/envoy/blob/21b70d126c0a5c16d844658ee2db68f94deb7548/source/extensions/http/stateful_session/cookie/cookie.cc#L21-L22

When HTTP requests are routed to different Envoy processes, they will have different values for their monotonic clock and the cookie can inadvertently expire sooner then its should, which will cause a new backend to get selected.

I believe the appropriate fix is for time_source_.systemTime() to be used so that two envoy processes can validate each other cookies.

cc @cpakulski

コントリビューターガイド