https://bz.apache.org/bugzilla/show_bug.cgi?id=66240
Bug ID: 66240
Summary: "Invalid octet [-1]. The valid range for IPv4 octets
is 0 to 255." error when subdomain is 4294967295
Product: Tomcat 9
Version: 9.0.x
Hardware: All
Status: NEW
Severity: normal
Priority: P2
Component: Catalina
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: -----
my coworker found this bug
reproduce
in /etc/hosts add
```
4294967295.localhost 127.0.0.1
```
run tomcat (9.0.65)
```
$ docker run -it --rm -p 8888:8080 tomcat:9.0
```
open browser and connect to http://4294967295.localhost:8888
log
```
26-Aug-2022 12:23:11.063 INFO [http-nio-8080-exec-1]
org.apache.coyote.AbstractProcessor.parseHost The host
[4294967295.localhost:8888] is not valid
Note: further occurrences of request parsing errors will be logged at DEBUG
level.
java.lang.IllegalArgumentException: Invalid octet [-1]. The valid range
for IPv4 octets is 0 to 255.
at
org.apache.tomcat.util.http.parser.HttpParser.readHostIPv4(HttpParser.java:731)
at org.apache.tomcat.util.http.parser.Host.parse(Host.java:73)
at org.apache.tomcat.util.http.parser.Host.parse(Host.java:45)
at
org.apache.coyote.AbstractProcessor.parseHost(AbstractProcessor.java:298)
at
org.apache.coyote.http11.Http11Processor.prepareRequest(Http11Processor.java:793)
at
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:375)
at
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:890)
at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1789)
at
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at
org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
at
org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:833)
```
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]