-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
Maksim Kostromin opened SPR-15529 and commented
(Updated title and description)
Right now when request curl http://localhost:3000// (or http :3000//) is sending (which is ends at least with one additional '/' symbol):
- URI.create will fail with message:
2017-05-08 23:30:21.770 WARN 24578 --- [ctor-http-nio-7] i.n.u.concurrent.AbstractEventExecutor : A task raised an exception. Task: reactor.ipc.netty.channel.ContextHandler$$Lambda$159/430674510@75bc1117
java.lang.IllegalArgumentException: Expected authority at index 2: //
- Terminal is hangs:
$ http :3000//
http: error: Request timed out (30s).
I didn't investigate what's going on with connection itself, probably it will not be closed some time. but anyway, As an attacker, I can easily DDOS spring 5 apps, I need only generate 65k these request for 30 sec and your service will be unavailable
issue can be reproduced using this example (reactive-service)
possible fix for that case is replace in uri-string few slashes with only one before it URI will be resolved. for example we can use:
uri.replaceAll("/{2,}", "/");
I've created PR with such fix: #1423
Affects: 5.0 RC1
Reference URL: spring-projects/spring-boot#9133
Issue Links:
- DDoS Spring 5 RouterFunction apps [SPR-15560] #20119 DDoS Spring 5 RouterFunction apps ("is superseded by")