runatlantis / atlantis

Terraform Pull Request Automation
https://www.runatlantis.io
Other
7.84k stars 1.06k forks source link

fix: code scanning alert no. 12: Reflected cross-site scripting #5078

Closed X-Guardian closed 2 weeks ago

X-Guardian commented 2 weeks ago

Fixes https://github.com/runatlantis/atlantis/security/code-scanning/12

To fix the reflected cross-site scripting vulnerability, we need to ensure that any user-controlled input is properly sanitized or escaped before being included in the HTTP response. In this case, we can use the html.EscapeString function from the html package to escape any potentially dangerous characters in the githubReqID before including it in the resp.body.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.