java version "21.0.3" 2024-04-16 LTS
Java(TM) SE Runtime Environment (build 21.0.3+7-LTS-235)
Java HotSpot(TM) 64-Bit Server VM (build 21.0.3+7-LTS-235, mixed mode)
OS type/version
Ubuntu 20.04.6 LTS
Description
I would like to report an issue related to inconsistent URL parsing in Jetty's org.eclipse.jetty.http.HttpURI class, which may lead to potential security risks.
When parsing certain malformed URLs containing invalid IPv6 literals and port numbers, Jetty's parsing behavior differs from standard parsers and its own newer versions. This inconsistency can cause unexpected results and may introduce vulnerabilities such as Server-Side Request Forgery (SSRF) and access control bypasses.
Jetty version(s)
Jetty Environment
Java version/vendor
(use: java -version)
OS type/version
Description
I would like to report an issue related to inconsistent URL parsing in Jetty's
org.eclipse.jetty.http.HttpURI
class, which may lead to potential security risks.When parsing certain malformed URLs containing invalid IPv6 literals and port numbers, Jetty's parsing behavior differs from standard parsers and its own newer versions. This inconsistency can cause unexpected results and may introduce vulnerabilities such as Server-Side Request Forgery (SSRF) and access control bypasses.
How to reproduce?
Test Payloads and Observed Behavior:
urllib3
http://[vulndetector.com]:99999
99999
http://vulndetector.com:99999/
99999
99999
http://localhost:-1
!hex 45
)localhost:-1
Port:
-1
http://[localhost:-1]
Reproduction Steps:
Code Sample:
Execution:
Expected Behavior:
Observed Behavior:
Jetty 12.0.10:
Jetty 12.0.12:
Additional Information:
RFC 3986 Compliance:
Potential Impact:
Recommendation:
org.eclipse.jetty.http.HttpURI
to ensure strict compliance with RFC 3986.