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

k8s/api: mitigate a path traversal bug #423

Merged
merged 1 commit into from
Jan 11, 2023

Conversation

AstroProfundis
Copy link
Contributor

What problem does this PR solve?

A path traversal bug presents in the re-collect API. We use the ID to build file path for collected data, but if the input id is a relative path like ./../../../../etc/passwd it could access those files outside the diag directory.

What is changed and how it works?

The ID is a base52 encoded timestamp, so just try to decode it and refuses any input that is not a valid base52 encoded timestamp.

@AstroProfundis AstroProfundis added the bug Something isn't working label Jan 11, 2023
@AstroProfundis AstroProfundis self-assigned this Jan 11, 2023
@AstroProfundis AstroProfundis merged commit f16a45c into pingcap:master Jan 11, 2023
@AstroProfundis AstroProfundis deleted the fix-path-leak branch January 11, 2023 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants