Aias00 opened a new pull request, #3361:
URL: https://github.com/apache/hertzbeat/pull/3361

   Potential fix for 
[https://github.com/apache/hertzbeat/security/code-scanning/88](https://github.com/apache/hertzbeat/security/code-scanning/88)
   
   To fix the SSRF vulnerability, we need to validate or restrict the 
user-provided `receiver.getWechatId()` value before appending it to the base 
URL. The best approach is to maintain a whitelist of allowed `wechatId` values 
or enforce a strict format (e.g., alphanumeric characters only). Additionally, 
we should ensure that the constructed URL is within the intended domain.
   
   1. Introduce a validation method to check the `wechatId` against a whitelist 
or a strict format.
   2. Validate the `receiver.getWechatId()` value before appending it to the 
base URL.
   3. If the validation fails, log a warning and throw an exception to prevent 
the request from being sent.
   
   ---
   
   
   _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]

Reply via email to