Skip to content

Disallow serving absolute paths from directory handler#160

Merged
devinivy merged 1 commit intomasterfrom
no-absolute-dir-handler
Aug 30, 2021
Merged

Disallow serving absolute paths from directory handler#160
devinivy merged 1 commit intomasterfrom
no-absolute-dir-handler

Conversation

@devinivy
Copy link
Copy Markdown
Member

While the directory handler would properly confine requests to only serve files from the configured path, it would still accept absolute paths to files within that directory through the route's path param. The directory handler is not intended to serve files using absolute paths, and we'd like to disallow the behavior. Thanks to Ryan Govostes for the report.

@devinivy devinivy added bug Bug or defect security Issue with security impact labels Aug 30, 2021
@devinivy devinivy added this to the 6.0.4 milestone Aug 30, 2021
Copy link
Copy Markdown
Member

@Nargonath Nargonath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @devinivy

@devinivy devinivy merged commit 16e04cd into master Aug 30, 2021
@devinivy devinivy deleted the no-absolute-dir-handler branch August 30, 2021 20:43
@devinivy devinivy self-assigned this Aug 30, 2021
@kanongil
Copy link
Copy Markdown
Contributor

Nice catch!

FYI, this issue will not have been exposed if running behind a standard nginx reverse proxy due to the default merge_slashes behaviour.

We might also want to add an option to hapi to remove such duplicate slashes from the incoming url, and make it default in a future breaking release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Bug or defect security Issue with security impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants