Cookie leakage between different users in fastapi-proxy-lib
High severity
GitHub Reviewed
Published
Dec 1, 2023
in
WSH032/fastapi-proxy-lib
•
Updated Dec 1, 2023
Description
Published to the GitHub Advisory Database
Dec 1, 2023
Reviewed
Dec 1, 2023
Last updated
Dec 1, 2023
Impact
In the implementation of version
0.0.1
, requests from different user clients are processed using a sharedhttpx.AsyncClient
.However, one oversight is that the
httpx.AsyncClient
will persistently store cookies based on theset-cookie
response header sent by the target server and share these cookies across different user requests.This results in a cookie leakage issue among all user clients sharing the same
httpx.AsyncClient
.Patches
It's fixed in
0.1.0
Workarounds
If you insist
0.0.1
:ForwardHttpProxy
at all.ReverseHttpProxy
orReverseWebSocketProxy
for any servers that may potentially send aset-cookie
response.However, it's best to upgrade to the latest version.
References
fixed in #10
References