-
Notifications
You must be signed in to change notification settings - Fork 6.5k
feat(api): protect static assets endpoint from symlink traversal #22936
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(api): protect static assets endpoint from symlink traversal #22936
Conversation
Signed-off-by: Michael Crenshaw <[email protected]>
❌ Preview Environment deleted from BunnyshellAvailable commands (reply to this comment):
|
Signed-off-by: Michael Crenshaw <[email protected]>
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.
Great addition, simple and focused.
|
I don't know why these tests failed, I'd try rerunning. |
|
Interesting, looks like fs.Root doesn't like it when the directory doesn't exist. I'll add code to check if it exists and then just log a warning if not (to match current behavior): |
Signed-off-by: Michael Crenshaw <[email protected]>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #22936 +/- ##
==========================================
+ Coverage 60.03% 60.08% +0.05%
==========================================
Files 344 344
Lines 57781 57795 +14
==========================================
+ Hits 34689 34729 +40
+ Misses 20333 20316 -17
+ Partials 2759 2750 -9 ☔ View full report in Codecov by Sentry. |
|
That got it. :-) |
…oproj#22936) Signed-off-by: Michael Crenshaw <[email protected]> Signed-off-by: Kanika Rana <[email protected]>
…oproj#22936) Signed-off-by: Michael Crenshaw <[email protected]> Signed-off-by: Oliver Gondža <[email protected]>
…oproj#22936) Signed-off-by: Michael Crenshaw <[email protected]>
…oproj#22936) Signed-off-by: Michael Crenshaw <[email protected]>
…oproj#22936) Signed-off-by: Michael Crenshaw <[email protected]> Signed-off-by: dsuhinin <[email protected]>
…oproj#22936) Signed-off-by: Michael Crenshaw <[email protected]> Signed-off-by: dsuhinin <[email protected]>
Taking advantage of new os.Root tool, building on ideas from here: #22932