Skip to content

Commit be728c9

Browse files
Copilotfrjcomp
andauthored
fix: add nosec G124 suppressions for client-side HTTP cookies (#617)
Agent-Logs-Url: https://github.com/CompassSecurity/pipeleek/sessions/895c3a0b-fd40-40d0-a9b4-178261cb42e6 Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: frjcomp <107982661+frjcomp@users.noreply.github.com>
1 parent a946ac9 commit be728c9

4 files changed

Lines changed: 4 additions & 3 deletions

File tree

pkg/bitbucket/scan/api.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ func NewClient(username string, password string, bitBucketCookie string, baseURL
4343
jar, _ := cookiejar.New(nil)
4444
// set cookie on the internal host root so requests to internal endpoints include it
4545
targetURL := &url.URL{Scheme: parsedBase.Scheme, Host: internalHost, Path: "/"}
46+
// #nosec G124 - Cookie attributes (Secure/HttpOnly/SameSite) are server-side browser directives; not applicable for client HTTP requests
4647
jar.SetCookies(targetURL, []*http.Cookie{
4748
{
4849
Name: "cloud.session.token",

pkg/gitea/scan/scanner.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ func InitializeOptions(token, giteaURL, repository, organization, cookie, maxArt
272272

273273
var httpClient *retryablehttp.Client
274274
if cookie != "" {
275-
//nolint:gosec
275+
// #nosec G124 - Cookie attributes (Secure/HttpOnly/SameSite) are server-side browser directives; not applicable for client HTTP requests
276276
httpClient = httpclient.GetPipeleekHTTPClient(
277277
giteaURL,
278278
[]*http.Cookie{

pkg/gitlab/scan/queue.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ func DownloadEnvArtifact(cookieVal string, gitlabUrl string, prjectPath string,
296296
reqUrl.RawQuery = q.Encode()
297297
dotenvUrl = reqUrl.String()
298298

299-
//nolint:gosec
299+
// #nosec G124 - Cookie attributes (Secure/HttpOnly/SameSite) are server-side browser directives; not applicable for client HTTP requests
300300
client := httpclient.GetPipeleekHTTPClient(gitlabUrl, []*http.Cookie{{Name: "_gitlab_session", Value: cookieVal}}, nil)
301301
resp, err := client.Get(dotenvUrl)
302302
if err != nil {

pkg/gitlab/util/util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func GetGitlabClient(token string, url string) (*gitlab.Client, error) {
104104
func CookieSessionValid(gitlabUrl string, cookieVal string) {
105105
gitlabSessionsUrl, _ := url.JoinPath(gitlabUrl, "-/user_settings/active_sessions")
106106

107-
//nolint:gosec
107+
// #nosec G124 - Cookie attributes (Secure/HttpOnly/SameSite) are server-side browser directives; not applicable for client HTTP requests
108108
client := httpclient.GetPipeleekHTTPClient(gitlabUrl, []*http.Cookie{{Name: "_gitlab_session", Value: cookieVal}}, nil)
109109
resp, err := client.Get(gitlabSessionsUrl)
110110
if err != nil {

0 commit comments

Comments
 (0)