Aias00 opened a new pull request, #3369: URL: https://github.com/apache/hertzbeat/pull/3369
Potential fix for [https://github.com/apache/hertzbeat/security/code-scanning/56](https://github.com/apache/hertzbeat/security/code-scanning/56) To fix the SSRF vulnerability, we need to validate and restrict the user-provided input (`metrics`) before incorporating it into the URL. The best approach is to maintain a whitelist of allowed metric names and validate the input against this list. If the input does not match any of the allowed values, the request should be rejected. Steps to implement the fix: 1. Define a whitelist of allowed metric names in `VictoriaMetricsDataStorage.java`. 2. Validate the `metrics` parameter against this whitelist before constructing the URI. 3. Reject any input that does not match the whitelist with an appropriate error message. --- _Suggested fixes powered by Copilot Autofix. Review carefully before merging._ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
