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

Fix directory traversal bug for smbComDeleteDirectory() #1864

Merged
merged 1 commit into from
Jan 9, 2025

Conversation

d0gkiller87
Copy link
Contributor

@d0gkiller87 d0gkiller87 commented Dec 20, 2024

In the smbComDeleteDirectory() function of smbserver.py, the return value of the isInFileJail() function is ignored:
https://github.com/fortra/impacket/blob/impacket_0_12_0/impacket/smbserver.py#L1756)

This allows an authenticated attacker (or simply by connecting to the IPC$ share: #1416) to bypass file jail restrictions and delete arbitrary empty directories.

The fix is to simply ensure that the return value of isInFileJail() is properly handled, like the other command handlers.

@gabrielg5 gabrielg5 added the bug Unexpected problem or unintended behavior label Dec 20, 2024
@alexisbalbachan alexisbalbachan merged commit bfa7b93 into fortra:master Jan 9, 2025
8 checks passed
@anadrianmanrique
Copy link
Contributor

anadrianmanrique commented Jan 9, 2025

Thanks for the PR @d0gkiller87!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants