Summary
The goal for is to avoid returning any sensitive server error when an unexpected error happens while interacting with hCaptcha server.
Background
Currently, when an error happen while interacting with hCaptcha server, we catch it and display it as a raw error message. These errors are not translated, do not provide much benefit to the user as those errors are mostly aimed at a developer audience, and could often disclose sensitive technical information such as the expiration of sitekey or any unwanted other details.
Technical notes
It would be safer to display an existing i18n message (eg: hcaptcha-load-error ) rather than the raw error message from hCaptcha server as we currently do in includes/hCaptcha/HCaptcha.php#198
Acceptance criteria
- Replace internal server error with generic, translated message
- Log the actual error from hCaptcha into logstash