-
Notifications
You must be signed in to change notification settings - Fork 186
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
Ruleset search bars don't sanitize input #3968
Comments
Related to #4312 |
I was researching a problem with a particular API search in the Wazuh plugin. When the value of search query parameter contains I was testing to do the desired request, without expected results. I don't know if this request is allowed by the API. I wil ask to the colleagues for more information. Some tests with cURL:
wz_api_token=$(curl -u wazuh:wazuh -s -k -X POST "https://localhost:55000/security/user/authenticate?raw=true")
curl -k -H "Authorization: Bearer ${wz_api_token}" https://localhost:55000/rules -G --data-urlencode "search=att&ck"
{"title": "Bad Request", "detail": "'att&ck' is not a 'search'. Failed validating 'format' in schema: {'format': 'search', 'type': 'string'}. On instance: 'att&ck'"}
curl -k -H "Authorization: Bearer ${wz_api_token}" https://localhost:55000/rules -G --data-urlencode "search=att%26ck"
{"title": "Bad Request", "detail": "'att&ck' is not a 'search'. Failed validating 'format' in schema: {'format': 'search', 'type': 'string'}. On instance: 'att&ck'"} API logs:
I attach some screenshots when using the Wazuh plugin. API logs:
|
According to the @vicferpoy , the _search_param = re.compile(r'^[^;|&^*>]+$') The I asked @gdiazlo what is the action item taking into account the shared information. |
According to @davidjiglesias , we could use the Another issue suggesting this approach: #5198 |
We move this issue to 4.5.0 because it needs some changes in the search bar and there is an epic issue #4312 to redo it. |
Closing this as the development is being done in #4312 |
In the Management > {Rules, Decoders, CDB lists} screens if special characters such as
&
or;
(ampersand or semicolon) are used in the search bar an error occurs.The full error dialog shows:
It's worth doing a thorough investigation of this as this may be indicative of a potential code injection possibility.
On 4.2.x the input is accepted although it won't find rules with a matching description.
Finally the error message
Error when get the items of rules
is grammatically incorrect and confusing.The text was updated successfully, but these errors were encountered: