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

Arguments for wazuh-api.js:makeRequest are not validated #1815

Closed
jesuslinares opened this issue Sep 25, 2019 · 1 comment
Closed

Arguments for wazuh-api.js:makeRequest are not validated #1815

jesuslinares opened this issue Sep 25, 2019 · 1 comment
Assignees
Labels
type/bug Bug issue
Milestone

Comments

@jesuslinares
Copy link
Contributor

jesuslinares commented Sep 25, 2019

The argument of wazuh-api.js:makeRequest must be validated to prevent possible security issues.

async makeRequest(method, path, data, id, reply)

Some ideas:

  • method: "^GET$|^PUT$|^POST$|^DELETE$"
  • path: "^/. +"
  • id: "^\d+$"
@jesuslinares jesuslinares added the type/bug Bug issue label Sep 25, 2019
@jesuslinares jesuslinares changed the title Arguments for wazuh-api.js:makeRequest are note validated Arguments for wazuh-api.js:makeRequest are not validated Sep 25, 2019
@juankaromo juankaromo self-assigned this Sep 25, 2019
@juankaromo
Copy link
Contributor

Hi @jesuslinares

From now on, the request method is validated (so that it can only be GET|PUT|POST|DELETE) and the path must start with /.

As for the id we can not validate it because although initially, it is a timestamp, you can modify the value in the index and, in addition, in the future version of Wazuh the index .wazuh will be obsolete in favor of a configuration file where users can enter the id they want.

https://github.com/wazuh/wazuh-kibana-app/blob/098c04546f04aeece69bdeac7bc3dbdbc481c600/server/controllers/wazuh-api.js#L964-L974

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Bug issue
Projects
None yet
Development

No branches or pull requests

3 participants