Skip to content

Replace many following slashes of client URI with single slash. [SPR-15529] #20088

@spring-projects-issues

Description

@spring-projects-issues

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):

  1. 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: //

  1. 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:

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)status: declinedA suggestion or change that we don't feel we should currently apply

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions