-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
feat(server): do path joins more safely #247
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #247 +/- ##
==========================================
+ Coverage 70.88% 71.20% +0.32%
==========================================
Files 11 11
Lines 625 639 +14
==========================================
+ Hits 443 455 +12
- Misses 182 184 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Co-authored-by: Orhun Parmaksız <[email protected]>
@orhun it seems that you have to approve the CI for the 2 PRs. |
But what I could ascertain from a quick look at the code is that prior to this PR errors were handled gracefully. After this PR rustypaste will panic. Not sure I like this. |
Yup, I also think that we should handle errors. |
There's only 1 panic this introduces, and it's during server startup. Sure, I could facade it to convert a path issue to |
What about the occurrences of Isn't it true that these can panic? P.S.: but I also noticed the change from |
There are other uses of Yes, the |
Oops, once again the gh diff failed me again. all the test headers were not in the code, thus I didn't see that those were tests. All good then.
I would rather see an error message than a panic. But it's up to orhun. |
Yes, it would be better to print out an error message than panicking. Also, there are some lints about the usage of |
Looks like there is a test failure:
|
ffb4a26
to
b5115d5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution!
Description
Check that a joined path is still a child of the original path.
Motivation and Context
When joining paths, there's little protection against directory traversal. From testing, Actix seems to nicely sanitises these in the request, which is great, but it's still better to add a little protection.
How Has This Been Tested?
Unit tests have been added, which pass.
Changelog Entry
Types of Changes
Checklist: