Skip to content

Security: AHC can be tricked into connecting to a different host #1455

Closed
@slandelle

Description

@slandelle

Issue is very similar to CVE-2016-8624 that affected cURL last year.

AHC url parser, org.asynchttpclient.uri.Uri can be tricked with a anchor containing a question mark into connecting to a different host. This issue also affects java.net.URL (as of 8u112) but not java.net.URI:

org.asynchttpclient.uri.Uri.create("http://1.2.3.4:81/#@5.6.7.8:82/aaa/b?q").getHost()
// 5.6.7.8

new java.net.URL("http://1.2.3.4:81/#@5.6.7.8:82/aaa/b?q").getHost()
// 5.6.7.8

java.net.URI.create("http://1.2.3.4:81/#@5.6.7.8:82/aaa/b?q").getHost()
// 1.2.3.4

Credit goes to Nicolas Grégoire from Agarri.

I'm not aware of any exploit at the moment.

Possible usages:

  • circumventing white/back lists
  • web crawler that would use AHC for fetching pages but would use java.net.URI to compute the index key.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions