You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While scanning go-test-bench with GoSec 2.11.0, GoSec outputs the following help message for G203 in the SARIF report:
"fullDescription": {
"text": "this method will not auto-escape HTML. Verify data is well formed."
},
this is not very helpful.
The CWE-79 name for G203 is:
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Based on the current description from GoSec the user does not know this is a potential 'Cross-site Scripting' vulnerability (weakness, security flaw). It would be better to tell the user this is all about 'Cross-site Scripting'. As the user can search for the term 'Cross-site Scripting', which leads to results. For example: https://owasp.org/www-community/attacks/xss/.
Steps to reproduce the behavior
Scan go-test-bench using GoSec. Make sure GoSec outputs a SARIF report.
gosec version
2.11.0
Go version (output of 'go version')
go version go1.18 linux/amd64
Operating system / Environment
GNU/Linux, Distribution: Ubuntu
Expected behavior
Provide a proper explanation of the finding G203. The finding should explain, what the problem is in a complete sentence.
"this method will not auto-escape HTML. Verify data is well formed."
better would be:
"The template.HTML() method does not auto-escape HTML. This can lead to potential 'Cross-site Scripting' vulnerabilities."
or
"The used method does not auto-escape HTML. In case, the user can influence the input. This can lead to potential 'Cross-site Scripting' vulnerabilities."
Summary
While scanning
go-test-bench
with GoSec 2.11.0, GoSec outputs the following help message for G203 in the SARIF report:this is not very helpful.
The CWE-79 name for G203 is:
Based on the current description from GoSec the user does not know this is a potential 'Cross-site Scripting' vulnerability (weakness, security flaw). It would be better to tell the user this is all about 'Cross-site Scripting'. As the user can search for the term 'Cross-site Scripting', which leads to results. For example: https://owasp.org/www-community/attacks/xss/.
Steps to reproduce the behavior
Scan go-test-bench using GoSec. Make sure GoSec outputs a SARIF report.
gosec version
2.11.0
Go version (output of 'go version')
go version go1.18 linux/amd64
Operating system / Environment
GNU/Linux, Distribution: Ubuntu
Expected behavior
Provide a proper explanation of the finding G203. The finding should explain, what the problem is in a complete sentence.
better would be:
or
Actual behavior
While scanning all G203 findings look like this:
Rule mapping from GoSec G203 to MITRE CWE 79:
The text was updated successfully, but these errors were encountered: