Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

caddyhttp: Refactor and export SanitizedPathJoin for use in fastcgi #4207

Merged
merged 1 commit into from Jun 17, 2021

Conversation

mholt
Copy link
Member

@mholt mholt commented Jun 14, 2021

Help prevent directory traversal within PHP apps. Basically we pulled sanitizedPathJoin() out of the file server and put it into caddyhttp and exported it so any middleware can use it for safe path joins.

Still needs some testing on Windows CI and in actual PHP environments.

@mholt mholt added the under review 🧐 Review is pending before merging label Jun 14, 2021
@mholt mholt added this to the v2.4.3 milestone Jun 14, 2021
@francislavoie
Copy link
Member

LGTM, but I'll play with it a bit this evening 👍

Copy link
Member

@francislavoie francislavoie left a comment

Choose a reason for hiding this comment

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

Ran this build on Windows to check how the env looks with a C:\ root, and the path is joined correctly.

LGTM! 🎉

@mholt
Copy link
Member Author

mholt commented Jun 17, 2021

Haven't heard back from the original reporter so I'm going to have to assume this is a satisfactory patch.

@mholt mholt merged commit 9d4ed3a into master Jun 17, 2021
@mholt mholt deleted the fcgi-pathjoin branch June 17, 2021 15:59
@mholt mholt removed the under review 🧐 Review is pending before merging label Jun 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants