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

sql injection vulnerability in /zendesk/api/users #179

Open
manueldimmler opened this issue Apr 4, 2022 · 2 comments
Open

sql injection vulnerability in /zendesk/api/users #179

manueldimmler opened this issue Apr 4, 2022 · 2 comments

Comments

@manueldimmler
Copy link

manueldimmler commented Apr 4, 2022

There is an sql injection vulnerability in /zendesk/api/users with low impact because it's behind the authentication.

People knowing the API token are able to query any information they want from the database using the 'sort' parameter. Because it's not possible to use UNION after ORDER BY, you have to guess one character after another using CASE WHEN.

Example guessing the first character of the password hash from user with id 1:
GET zendesk/api/users?sort=(CASE WHEN (SELECT SUBSTRING(password, 1, 1) FROM admin_user WHERE user_id = 1) = 'a' THEN firstname ELSE lastname END)

This could be fixed adding a default fallback to the switch statement to prevent inserting custom sql commands in https://github.com/agnostack/magento_extension/blob/develop/src/app/code/community/Zendesk/Zendesk/controllers/ApiController.php#L246

manueldimmler added a commit to manueldimmler/zendesk_magento_extension that referenced this issue Apr 4, 2022
@agrohs
Copy link
Contributor

agrohs commented Feb 8, 2023

Thanks for calling this out @manueldimmler - are you able to submit a PR for it by chance?

@agrohs
Copy link
Contributor

agrohs commented Apr 4, 2023

cc: @rsbowers

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