Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linter: gosec, Rule: G113 - Usage of Rat.SetString in math/big with an overflow (CVE-2022-23772). Should we enable it? #12900

Closed
zak-pawel opened this issue Mar 18, 2023 · 3 comments
Labels

Comments

@zak-pawel
Copy link
Collaborator

Use Case

This issue starts discussion about enabling:

Rule is mapped to CWE-190: Integer Overflow or Wraparound.

Expected behavior

Decision if rule should be enabled or not.

Actual behavior

For this rule following finding was found in current code:

internal/internal.go:317:15  gosec  G113: Potential uncontrolled memory consumption in Rat.SetString (CVE-2022-23772)

Additional info

For this rule no additional configuration can be provided.

@zak-pawel zak-pawel added feature request Requests for new plugin and for new features to existing plugins needs design review labels Mar 18, 2023
@zak-pawel zak-pawel changed the title Linter: gosec, G113 - Usage of Rat.SetString in math/big with an overflow (CVE-2022-23772). Should we enable it? Linter: gosec, Rule: G113 - Usage of Rat.SetString in math/big with an overflow (CVE-2022-23772). Should we enable it? Mar 18, 2023
@powersj
Copy link
Contributor

powersj commented Mar 21, 2023

+1

@zak-pawel zak-pawel added linter and removed feature request Requests for new plugin and for new features to existing plugins needs design review labels Mar 22, 2023
@zak-pawel
Copy link
Collaborator Author

Potential large memory consumption for this method was fixed in Go 1.17.7 and Go 1.16.14:
https://groups.google.com/g/golang-announce/c/SUsQn0aSgPQ

Since Telegraf requires Go version >= 1.20, I believe we don't want to enable this one.

@powersj What do you think?

@powersj
Copy link
Contributor

powersj commented Mar 30, 2023

sounds good to omit this one then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants