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

Safer path operations #14490

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

simondeziel
Copy link
Member

@simondeziel simondeziel commented Nov 18, 2024

Signed-off-by: Simon Deziel <[email protected]>
This protects against malicious use of `..` in path elements being joined
resulting in accessing files/directories outside of the expected parent dir.

Signed-off-by: Simon Deziel <[email protected]>
`fmt.Sprintf` being much slower it should be kept for when it is really needed.
It's slowness comes from using reflection under the hood making it the slowest
of the `fmt.Sprint*` functions.

Signed-off-by: Simon Deziel <[email protected]>
@simondeziel simondeziel marked this pull request as ready for review November 18, 2024 21:28
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.

2 participants