Skip to content

Better document the connection between HttpServerRequest#path() and RoutingContext#normalizedPath() #2831

@gsmet

Description

@gsmet

Describe the feature

In Quarkus, we often see people confused and using HttpServerRequest#path() instead of RoutingContext#normalizedPath().

This can lead to potential security issues if we are not careful when people are using paths like /../secured/resource/ and there is some matching on /secured/resource.
On our security layer, we have been careful about that but there are some less critical extensions where we were using the original request path where we should actually have used the normalized path.

I'm not exactly sure how we can help with that. One option would be to extend the HttpServerRequest#path() javadoc to clearly state it's a non-normalized path and RoutingContext#normalizedPath() should be used to get the normalized path... but it crosses the modules boundary so I'm not sure you will like it.

In any case, even seasoned developers on our side made the mistake and we also had users complaining so I think it's worth trying to improve the situation.

Contribution

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions