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

To operate an empty key will result in operating the bucket #342

Open
yonoho opened this issue May 10, 2023 · 0 comments
Open

To operate an empty key will result in operating the bucket #342

yonoho opened this issue May 10, 2023 · 0 comments

Comments

@yonoho
Copy link

yonoho commented May 10, 2023

in file oss2/api.py: Line 2753

    def __do_object(self, method, key, **kwargs):
        return self._do(method, self.bucket_name, key, **kwargs)

    def __do_bucket(self, method, **kwargs):
        return self._do(method, self.bucket_name, '', **kwargs)

As it shows, when calling __do_object() with key='', it equals calling __do_bucket(), and there aren't any checks before that。if the client calls bucket.delete_object(key='') accidentally, the whole bucket may be deleted, which is really dangerous.

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

No branches or pull requests

1 participant