Skip to content

Commit 3b0e3e9

Browse files
committed
Patch Security Advisory: GHSA-fmxf-pm6p-7xgm
1 parent a279d48 commit 3b0e3e9

5 files changed

Lines changed: 319 additions & 8 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ Java 11+
5353
<dependency>
5454
<groupId>org.asynchttpclient</groupId>
5555
<artifactId>async-http-client</artifactId>
56-
<version>3.0.9</version>
56+
<version>3.0.10</version>
5757
</dependency>
5858
```
5959

6060
**Gradle:**
6161

6262
```groovy
63-
implementation 'org.asynchttpclient:async-http-client:3.0.9'
63+
implementation 'org.asynchttpclient:async-http-client:3.0.10'
6464
```
6565

6666
<details>

client/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<parent>
2020
<groupId>org.asynchttpclient</groupId>
2121
<artifactId>async-http-client-project</artifactId>
22-
<version>3.0.9</version>
22+
<version>3.0.10</version>
2323
</parent>
2424

2525
<modelVersion>4.0.0</modelVersion>

client/src/main/java/org/asynchttpclient/netty/handler/intercept/Redirect30xInterceptor.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
import static io.netty.handler.codec.http.HttpHeaderNames.AUTHORIZATION;
4242
import static io.netty.handler.codec.http.HttpHeaderNames.CONTENT_LENGTH;
4343
import static io.netty.handler.codec.http.HttpHeaderNames.CONTENT_TYPE;
44+
import static io.netty.handler.codec.http.HttpHeaderNames.COOKIE;
4445
import static io.netty.handler.codec.http.HttpHeaderNames.HOST;
4546
import static io.netty.handler.codec.http.HttpHeaderNames.LOCATION;
4647
import static io.netty.handler.codec.http.HttpHeaderNames.PROXY_AUTHORIZATION;
@@ -113,7 +114,9 @@ public boolean exitAfterHandlingRedirect(Channel channel, NettyResponseFuture<?>
113114
boolean schemeDowngrade = request.getUri().isSecured() && !newUri.isSecured();
114115
boolean stripAuth = !sameBase || schemeDowngrade || stripAuthorizationOnRedirect;
115116

116-
if (stripAuth && (request.getRealm() != null || request.getHeaders().contains(AUTHORIZATION))) {
117+
if (stripAuth && (request.getRealm() != null
118+
|| request.getHeaders().contains(AUTHORIZATION)
119+
|| request.getHeaders().contains(COOKIE))) {
117120
LOGGER.debug("Stripping credentials on redirect to {}", newUri);
118121
}
119122

@@ -209,8 +212,14 @@ private static HttpHeaders propagatedHeaders(Request request, Realm realm, boole
209212
headers.remove(CONTENT_TYPE);
210213
}
211214

212-
if (stripAuthorization || (realm != null && (realm.getScheme() == AuthScheme.NTLM
213-
|| realm.getScheme() == AuthScheme.SCRAM_SHA_256))) {
215+
if (stripAuthorization) {
216+
// Cookie is dropped only on the security boundary; the URI-scoped CookieStore re-adds
217+
// any cookies that legitimately match the new target after this method returns.
218+
headers.remove(AUTHORIZATION)
219+
.remove(PROXY_AUTHORIZATION)
220+
.remove(COOKIE);
221+
} else if (realm != null && (realm.getScheme() == AuthScheme.NTLM
222+
|| realm.getScheme() == AuthScheme.SCRAM_SHA_256)) {
214223
headers.remove(AUTHORIZATION)
215224
.remove(PROXY_AUTHORIZATION);
216225
}

0 commit comments

Comments
 (0)