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

Lack of data validation #33

Open
disconnect3d opened this issue Jul 26, 2021 · 1 comment
Open

Lack of data validation #33

disconnect3d opened this issue Jul 26, 2021 · 1 comment

Comments

@disconnect3d
Copy link

The code does not perform any data validation of the arguments passed into given API methods, which may cause different operations to be triggered if the data is controlled by an untrusted party.

As an example, if the app_id passed into the Apps.delete_app method is controlled by an attacker, they can trigger a DELETE http request into any other endpoint as the final url is constructed as:

def delete_app(self, app_id):
"""delete an app"""
url = self.url + "/" + app_id
data = {}
return self._delete_data(url, data) #pylint: disable=too-many-function-args

This may allow e.g. to trigger a ManagedAppConfigs.delete_config case if the attacker would know both app_id and managed_config_id.

While this case may not be a good attack example, since none of the arguments are validated, this can be true for any other HTTP method and endpoint used. Additionally, the untrusted input can also traverse the paths upper with "../some_other_endpoint/" and most likely to make the MDM backend server to ignore a given path suffix. For example in:

url = self.url + "/" + app_id + "/managed_configs/" + managed_config_id

We can provide app_id = "some_path#" or app_id = "some_path?a=" since the other server most likely doesn't care about additional query params or anchor marker in URLs.

@MagerValp
Copy link
Collaborator

I'm not sure I agree that this is the responsibility of SimpleMDMpy, but I am thinking about reworking url construction which would be a place to insert this. Do you have any examples of other libraries that perform validation?

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

2 participants