-
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
Sanitize report's inputs and usernames #4330
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing ✅
- Check the reports' folder for a user $WAZUH_APP_HOME/downloads/reports/ has been automatically renamed to $WAZUH_APP_HOME/downloads/reports/hash(), and that their reports are still inside the new folder.
Screen.Recording.2022-07-14.at.15.14.59.mov
- Check no report from other users can be obtained.
- Check there are no collisions between files in read/write operations.
-
Check the report name is no longer sent from the frontend (check the request using the dev tools).
-
Check that usernames with UTF-8 characters gets encoded by the MD5 hash function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Check the reports' folder for a user
$WAZUH_APP_HOME/downloads/reports/<username>
has been automatically renamed to$WAZUH_APP_HOME/downloads/reports/hash(<username>)
, and that their reports are still inside the new folder.
- Check no report from other users can be obtained.
- Check there are no collisions between files in read/write operations.
-
Check the report name is no longer sent from the frontend (check the request using the dev tools).
-
Check that usernames with UTF-8 characters gets encoded by the MD5 hash function.
|
* Validate path parameters of the reports endpoint * Remove leftover prop in the reporting-table component * Fix typo in report name validtion * Remove the return of reports path from the /reports endpoint * Remove absolute file path on report not found (cherry picked from commit 3c1e51c)
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-4.3-1.2-wzd 4.3-1.2-wzd
# Navigate to the new working tree
cd .worktrees/backport-4.3-1.2-wzd
# Create a new branch
git switch --create backport-4330-to-4.3-1.2-wzd
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 3c1e51cbc8d4c269d08df90f855d1f07e4897fd6
# Push it to GitHub
git push --set-upstream origin backport-4330-to-4.3-1.2-wzd
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-4.3-1.2-wzd Then, create a pull request where the |
* Validate path parameters of the reports endpoint * Remove leftover prop in the reporting-table component * Fix typo in report name validtion * Remove the return of reports path from the /reports endpoint * Remove absolute file path on report not found (cherry picked from commit 3c1e51c)
Sanitize report's inputs and usernames (#4330) * Validate path parameters of the reports endpoint * Remove leftover prop in the reporting-table component * Fix typo in report name validtion * Remove the return of reports path from the /reports endpoint * Remove absolute file path on report not found (cherry picked from commit 3c1e51c) Co-authored-by: Álex <alejandro.ruiz.becerra@wazuh.com>
Sanitize report's inputs and usernames (#4330) * Validate path parameters of the reports endpoint * Remove leftover prop in the reporting-table component * Fix typo in report name validtion * Remove the return of reports path from the /reports endpoint * Remove absolute file path on report not found (cherry picked from commit 3c1e51c)
Summary
Closes #4329
To test
$WAZUH_APP_HOME/downloads/reports/<username>
has been automatically renamed to$WAZUH_APP_HOME/downloads/reports/hash(<username>)
, and that their reports are still inside the new folder.