-
Notifications
You must be signed in to change notification settings - Fork 5.6k
fix(security): prevent path traversal in user data deletion #2086
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
base: main
Are you sure you want to change the base?
Conversation
|
@tkiran please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
Problem: UserManager.remove_user() built user_path = self.data_path / user_id and then called shutil.rmtree(user_path). Because user_id is user-controlled, an attacker could supply traversal/absolute paths (e.g., ../.., C:\Windows, \server\share) to delete directories outside the intended user data directory.
Impact: Arbitrary recursive directory deletion (critical), potentially wiping system files or other application data.
Fix: Added strict user_id validation and a safe path resolver that: