1
0
mirror of https://github.com/securego/gosec.git synced 2025-07-03 00:27:05 +02:00
Commit Graph

22 Commits

Author SHA1 Message Date
d514c42671 chore(deps): update all dependencies (#1333)
* chore(deps): update all dependencies

* Fix all lint warnings after upgrading golangci-lint action

Change-Id: I7b4162307ae0d6a1c9ec00b7127469c64ed93f64
Signed-off-by: Cosmin Cojocar <ccojocar@google.com>

* Remove the backup file

Signed-off-by: Cosmin Cojocar <ccojocar@google.com>

---------

Signed-off-by: Cosmin Cojocar <ccojocar@google.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Cosmin Cojocar <ccojocar@google.com>
2025-04-07 13:12:14 +02:00
1336dc6820 remove G113. It only affects old/unsupported versions of Go (#1328)
* don't warn on G113 (big.Rat SetString) if on an unaffected version of Go

Newer versions of go (>=1.16.14, >=1.17.7, 1.18+) are not affected by this. Don't warn at all on those newer versions. See https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-23772

* alert on all known versions

Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>

* remove G113 CVE-2022-23772 which only affects old/unsupport Go versions

* Retire rule

* gofmt

---------

Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
2025-04-03 16:44:20 +02:00
0eb8143c23 Added new rule G407(hardcoded IV/nonce)
The rule is supposed to detect for the usage of hardcoded or static nonce/Iv in many encryption algorithms:

* The different modes of AES (mainly tested here)
* It should be able to work with ascon

Currently the rules doesn't check when constant variables are used.

TODO: Improve the rule, to detected for constatant variable usage
2024-08-30 19:35:07 +02:00
56f943b802 Add support to generate auto fixes using LLM (AI) (#1177)
This feature adds support to generate auto fixes for Go scanning findings using LLM (AI). In a first instance, it relies on Gemini API to get a suggestion for a solution. This can be later extended, to integrate also other AI providers.

---------

Signed-off-by: Cosmin Cojocar <ccojocar@google.com>
Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
Co-authored-by: Cosmin Cojocar <ccojocar@google.com>
2024-08-12 12:52:41 +02:00
9a4a741e6b Added more rules
* Rule G406 responsible for the usage of deprecated MD4 and RIPEMD160 added.
* Rules G506, G507 responsible for tracking the usage of the already mentioned libraries added.
* Slight changes in the Makefile(`make clean` wasn't removing all expected files)
* Added license to `analyzer_test.go`
2024-06-25 13:18:27 +02:00
58e4fccc13 Split the G401 rule into two separate ones
Now the G401 rule is split into hashing and encryption algorithms.

G401 is responsible for checking the usage of MD5 and SHA1, with corresponding CWE of 328.
And G405(New rule) is responsible for checking the usege of DES and RC4, with corresponding CWE of 327.
2024-06-24 15:25:54 +02:00
1f689968ec Fix typos in comments, vars and tests 2023-05-30 08:26:41 +02:00
d6aeaad931 correct gci linter (#946)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2023-03-30 09:31:24 +02:00
6a73248135 Fix some linting warnings 2023-03-20 10:25:45 +01:00
de2c6a36fa Extract the issue in its own package 2023-02-16 09:45:28 +01:00
a522ae6f5f Fix build after updating the dependencies (#910) 2023-01-09 09:42:20 +01:00
9c19cb6501 Add check for usage of Rat.SetString in math/big with an overflow error (#819)
* Add check for usage of Rat.SetString in math/big with an overflow error

Rat.SetString in math/big in Go before 1.16.14 and 1.17.x before 1.17.7
has an overflow that can lead to Uncontrolled Memory Consumption.

It is the CVE-2022-23772.

* Use ContainsPkgCallExpr instead of manual parsing
2022-06-03 00:19:51 +02:00
34d144b3fa Add new rule for Slowloris Attack 2022-04-30 12:38:50 +02:00
48bbf96b56 Adds directory traversal for Http.Dir("/") 2022-03-06 10:58:47 +01:00
ad5d74d5a1 Update to ginkgo v2 (#753) 2022-01-03 18:11:35 +01:00
b45f95f6ad Add support for suppressing the findings 2021-12-09 11:53:36 +01:00
1256f16f33 Fix lint and fail on error in the ci build 2021-05-31 10:44:12 +02:00
e72f54ed40 Fix HTML template and display the gosec version 2021-05-21 11:14:43 +02:00
d040f0725f Handle gosec version in SARIF report 2021-05-20 10:16:42 +02:00
103c429df5 Enable golangcli and improve testing for formatters 2021-05-10 10:08:04 +02:00
c4f5932ab7 Refactor : Replace Cwe with cwe.Weakness 2021-05-07 16:54:34 +02:00
ddfa25381f Define a report package with core and per format sub-packages 2021-05-06 09:31:51 +02:00