You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The CORS middleware fails to add a Vary: Origin header in responses in some cases where it's needed.
Multiple origins allowed vs CORS request from a disallowed origin
If multiple origins are allowed (but not via the wildcard) and a CORS request comes from a disallowed origin, the response lacks a Vary: Origin header. Here's a failing test case that illustrates the problem:
Why is it problematic? Because caching intermediaries may cache such a response, which would subsequently get served to clients that do issue requests from allowed origins. In essence, this would lead to a limited form of denial of service for as long as that "bad" response remains in the cache.
Multiple origins allowed vs non-CORS request
A similar issue exists when the request lacks an Origin header. Here's a failing test case that illustrates the problem:
Is there an existing issue for this?
Current Behavior
The CORS middleware fails to add a
Vary: Origin
header in responses in some cases where it's needed.Multiple origins allowed vs CORS request from a disallowed origin
If multiple origins are allowed (but not via the wildcard) and a CORS request comes from a disallowed origin, the response lacks a
Vary: Origin
header. Here's a failing test case that illustrates the problem:Why is it problematic? Because caching intermediaries may cache such a response, which would subsequently get served to clients that do issue requests from allowed origins. In essence, this would lead to a limited form of denial of service for as long as that "bad" response remains in the cache.
Multiple origins allowed vs non-CORS request
A similar issue exists when the request lacks an
Origin
header. Here's a failing test case that illustrates the problem:Multiple origins allowed via
AllowedOriginValidator
Similar issue for users who opt for
AllowedOriginValidator
to allow multiple origins:Edit: this specific problem was already reported in #244
Expected Behavior
In both cases, the middleware should list
Origin
in aVary
response header.Steps To Reproduce
Reproducible in v1.5.1.
Anything else?
The text was updated successfully, but these errors were encountered: