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
fix: don't re-stamp bearer token on a cross-origin-redirect 401
A cross-origin redirect re-issue reaches the AUTH stage stripped of its
Authorization header and tagged with the internal cross-origin marker, so
the stage forwards it credential-free. If the foreign host answered that
request with a 401 + WWW-Authenticate, the challenge hook unconditionally
re-stamped Authorization: Bearer <token> onto the server-chosen host and
re-drove it through the chain — leaking the caller's token cross-origin and
bypassing the HTTPS guard, which only the first pass through process()
enforces.
The challenge hook now returns null (surfacing the 401 unchanged) when the
rejected request carried no Authorization header, since that only happens
when the AUTH stage deliberately suppressed stamping. Route the bearer
header value through a single bearerHeaderValue() helper shared by stamping
and the eviction match so the two cannot drift, and document that a subclass
customizing the header format must override it. Add a test for a
cross-origin-marked request that 401s.
Copy file name to clipboardExpand all lines: sdk-core/api/sdk-core.api
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -756,6 +756,7 @@ public class org/dexpace/sdk/core/http/pipeline/steps/BearerTokenAuthStep : org/
756
756
public synthetic fun <init> (Lorg/dexpace/sdk/core/http/auth/BearerTokenProvider;Ljava/util/List;Ljava/time/Duration;Lorg/dexpace/sdk/core/util/Clock;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
757
757
protected fun authorizeRequest (Lorg/dexpace/sdk/core/http/request/Request;)Lorg/dexpace/sdk/core/http/request/Request;
758
758
protected fun authorizeRequestOnChallenge (Lorg/dexpace/sdk/core/http/request/Request;Lorg/dexpace/sdk/core/http/response/Response;)Lorg/dexpace/sdk/core/http/request/Request;
759
+
protected fun bearerHeaderValue (Ljava/lang/String;)Ljava/lang/String;
759
760
}
760
761
761
762
public final class org/dexpace/sdk/core/http/pipeline/steps/DefaultAsyncInstrumentationStep : org/dexpace/sdk/core/http/pipeline/AsyncHttpStep {
0 commit comments