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

fix semgrep issues with https://github.com/dgryski/semgrep-go ruleset #3509

Closed
dmitris opened this issue Feb 15, 2024 · 0 comments · Fixed by #3511
Closed

fix semgrep issues with https://github.com/dgryski/semgrep-go ruleset #3509

dmitris opened this issue Feb 15, 2024 · 0 comments · Fixed by #3511
Assignees
Labels

Comments

@dmitris
Copy link
Contributor

dmitris commented Feb 15, 2024

We need to fix these issues flagged by semgrep when run with the https://github.com/dgryski/semgrep-go ruleset ruleset:
https://gist.github.com/dmitris/908a85d205249f2018f4688308fb5053

semgrep --config http://semgrep.dev/r/dgryski.semgrep-go
┌──────────────────┐
│ 15 Code Findings │
└──────────────────┘
[...]

Related to #1551.

dmitris added a commit to dmitris/prebid-server that referenced this issue Feb 15, 2024
Fix most of the semgrep issues with the
http://semgrep.dev/r/dgryski.semgrep-go ruleset
(`semgrep --config http://semgrep.dev/r/dgryski.semgrep-go`).
Left the issue with Content-Type text/plain on json.Encode
in endpoints/openrtb2/amp_auction.go since changing to
application/json breaks the AMP unit tests, and issues
with the pointer receiver for MarshalJSON in usersync/cookie.go.

Fix prebid#3509.

Signed-off-by: Dmitry S <[email protected]>
dmitris added a commit to dmitris/prebid-server that referenced this issue Feb 20, 2024
Fix most of the semgrep issues with the
http://semgrep.dev/r/dgryski.semgrep-go ruleset
(`semgrep --config http://semgrep.dev/r/dgryski.semgrep-go`).
Left the issue with Content-Type text/plain on json.Encode
in endpoints/openrtb2/amp_auction.go since changing to
application/json breaks the AMP unit tests, and issues
with the pointer receiver for MarshalJSON in usersync/cookie.go.

Fix prebid#3509.

Signed-off-by: Dmitry S <[email protected]>
@bretg bretg added the PBS-Go label Feb 20, 2024
dmitris added a commit to dmitris/prebid-server that referenced this issue Feb 23, 2024
Fix most of the semgrep issues with the
http://semgrep.dev/r/dgryski.semgrep-go ruleset
(`semgrep --config http://semgrep.dev/r/dgryski.semgrep-go`).
Left the issue with Content-Type text/plain on json.Encode
in endpoints/openrtb2/amp_auction.go since changing to
application/json breaks the AMP unit tests, and issues
with the pointer receiver for MarshalJSON in usersync/cookie.go.

Fix prebid#3509.

Signed-off-by: Dmitry S <[email protected]>
dmitris added a commit to dmitris/prebid-server that referenced this issue Mar 5, 2024
Fix most of the semgrep issues with the
http://semgrep.dev/r/dgryski.semgrep-go ruleset
(`semgrep --config http://semgrep.dev/r/dgryski.semgrep-go`).
Left the issue with Content-Type text/plain on json.Encode
in endpoints/openrtb2/amp_auction.go since changing to
application/json breaks the AMP unit tests, and issues
with the pointer receiver for MarshalJSON in usersync/cookie.go.

Fix prebid#3509.

Signed-off-by: Dmitry S <[email protected]>
dmitris added a commit to dmitris/prebid-server that referenced this issue Mar 13, 2024
Fix most of the semgrep issues with the
http://semgrep.dev/r/dgryski.semgrep-go ruleset
(`semgrep --config http://semgrep.dev/r/dgryski.semgrep-go`).
Left the issue with Content-Type text/plain on json.Encode
in endpoints/openrtb2/amp_auction.go since changing to
application/json breaks the AMP unit tests, and issues
with the pointer receiver for MarshalJSON in usersync/cookie.go.

Fix prebid#3509.

Signed-off-by: Dmitry S <[email protected]>
hhhjort pushed a commit that referenced this issue Mar 25, 2024
* fix semgrep dgryski.semgrep-go issues

Fix most of the semgrep issues with the
http://semgrep.dev/r/dgryski.semgrep-go ruleset
(`semgrep --config http://semgrep.dev/r/dgryski.semgrep-go`).
Left the issue with Content-Type text/plain on json.Encode
in endpoints/openrtb2/amp_auction.go since changing to
application/json breaks the AMP unit tests, and issues
with the pointer receiver for MarshalJSON in usersync/cookie.go.

Fix #3509.

Signed-off-by: Dmitry S <[email protected]>

* add comment about legacy text/plain content type

Signed-off-by: Dmitry S <[email protected]>

* fix semgrep dgryski issue with w.Write, add nosemgrep

Signed-off-by: Dmitry S <[email protected]>

* add nosemgrep ignore for marshal-json-pointer-receiver

---------

Signed-off-by: Dmitry S <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants