mirror of
https://github.com/securego/gosec.git
synced 2026-06-20 00:15:59 +02:00
Add G121 analyzer for unsafe CORS bypass patterns in CrossOriginProtection (#1521)
* Add G121 analyzer for unsafe CORS bypass patterns in CrossOriginProtection Adds new SSA-only analyzer G121 to detect unsafe usage of AddInsecureBypassPattern in net/http.CrossOriginProtection. Flags: overbroad static bypass patterns (for example /, /*, empty/wildcard-like values), request-derived dynamic bypass patterns. Wires G121 into default analyzer registration, analyzer test suite, CWE mapping (CWE-346), README rule list, and dedicated sample fixtures. Includes a narrow lint suppression for a G101 false positive in analyzer message constants. Validation: analyzer tests pass and golangci-lint reports 0 issues. Signed-off-by: Cosmin Cojocar <cosmin@cojocar.ch> * Ignore false positive warnings Signed-off-by: Cosmin Cojocar <cosmin@cojocar.ch> --------- Signed-off-by: Cosmin Cojocar <cosmin@cojocar.ch>
This commit is contained in:
@@ -72,6 +72,7 @@ var ruleToCWE = map[string]string{
|
||||
"G118": "400",
|
||||
"G119": "200",
|
||||
"G120": "400",
|
||||
"G121": "346",
|
||||
"G201": "89",
|
||||
"G202": "89",
|
||||
"G203": "79",
|
||||
|
||||
Reference in New Issue
Block a user