Axios Cache Interceptor to interceptor cache dla axios. Przed wersją 1.11.1, gdy serwer wywołuje usługę upstream przy użyciu różnych tokenów uwierzytelniania, axios-cache-interceptor zwraca nieprawidłowe odpowiedzi z cache'a, prowadząc do authorization bypass. Klucz cache'a jest generowany wyłącznie z URL, ignorując nagłówki żądania takie jak `Authorization`. Gdy serwer odpowiada z `Vary: Authorization` (wskazując że odpowiedź zmienia się w zależności od tokenu auth), biblioteka to ignoruje, powodując że wszystkie żądania współdzielą ten sam cache niezależnie od autoryzacji. Dotyczy to aplikacji po stronie serwera (API, proxy, usługi backendowe) które używają axios-cache-interceptor do cache'owania żądań do usług upstream, obsługują żądania od wielu użytkowników z różnymi tokenami auth, oraz które polegają na `Vary` do różnicowania cache'a. Aplikacje przeglądarki/klienta (jeden użytkownik na sesję przeglądarki) nie są dotknięte
▸ Pokaż oryginał (EN)
Axios Cache Interceptor is a cache interceptor for axios. Prior to version 1.11.1, when a server calls an upstream service using different auth tokens, axios-cache-interceptor returns incorrect cached responses, leading to authorization bypass. The cache key is generated only from the URL, ignoring request headers like `Authorization`. When the server responds with `Vary: Authorization` (indicating the response varies by auth token), the library ignores this, causing all requests to share the same cache regardless of authorization. Server-side applications (APIs, proxies, backend services) that use axios-cache-interceptor to cache requests to upstream services, handle requests from multiple users with different auth tokens, and upstream services replies on `Vary` to differentiate caches are affected. Browser/client-side applications (single user per browser session) are not affected. Services using different auth tokens to call upstream services will return incorrect cached data, bypassing authorization checks and leaking user data across different authenticated sessions. After `v1.11.1`, automatic `Vary` header support is now enabled by default. When server responds with `Vary: Authorization`, cache keys now include the authorization header value. Each user gets their own cache.
CVSS:4.0/AV:N/AC:H/AT:P/PR:L/UI:N/VC:H/VI:N/VA:N/SC:L/SI:L/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:XAxios Cache Interceptor
APPAxios-Cache-Interceptor< 1.11.1