Skip to content

Commit 3107edf

Browse files
Fixes and doc updates
1 parent a68b7ca commit 3107edf

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

go/ql/lib/go.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import semmle.go.frameworks.ElazarlGoproxy
4040
import semmle.go.frameworks.Email
4141
import semmle.go.frameworks.Encoding
4242
import semmle.go.frameworks.Fasthttp
43+
import semmle.go.frameworks.Gin
4344
import semmle.go.frameworks.GinCors
4445
import semmle.go.frameworks.Glog
4546
import semmle.go.frameworks.GoJose

go/ql/lib/semmle/go/concepts/HTTP.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ module Http {
381381
predicate guardedBy(DataFlow::Node check) { super.guardedBy(check) }
382382
}
383383

384-
/** Provides a class for modelling HTTP response cookie writes. */
384+
/** Provides a class for modeling HTTP response cookie writes. */
385385
module CookieWrite {
386386
/**
387387
* An write of an HTTP Cookie to an HTTP response.
@@ -424,7 +424,7 @@ module Http {
424424
DataFlow::Node getHttpOnly() { result = super.getHttpOnly() }
425425
}
426426

427-
/** Provides a class for modelling the options of an HTTP cookie. */
427+
/** Provides a class for modeling the options of an HTTP cookie. */
428428
module CookieOptions {
429429
/**
430430
* An HTTP Cookie object.

go/ql/lib/semmle/go/frameworks/stdlib/NetHttp.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ module NetHttp {
294294
override DataFlow::Node getAPathArgument() { result = this.getArgument(2) }
295295
}
296296

297-
class CookieWrite extends Http::CookieWrite::Range, DataFlow::CallNode {
297+
private class CookieWrite extends Http::CookieWrite::Range, DataFlow::CallNode {
298298
CookieWrite() { this.getTarget().hasQualifiedName(package("net/http", ""), "SetCookie") }
299299

300300
override DataFlow::Node getName() { result = this.getArgument(1) }
@@ -306,7 +306,7 @@ module NetHttp {
306306
override DataFlow::Node getHttpOnly() { result = this.getArgument(1) }
307307
}
308308

309-
class CookieFieldWrite extends Http::CookieOptions::Range {
309+
private class CookieFieldWrite extends Http::CookieOptions::Range {
310310
Write w;
311311
Field f;
312312
DataFlow::Node written;

go/ql/src/Security/CWE-1004/CookieWithoutHttpOnly.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
* @kind path-problem
88
* @problem.severity warning
99
* @precision high
10+
* @security-severity 5.0
1011
* @id go/cookie-httponly-not-set
1112
* @tags security
1213
* external/cwe/cwe-1004
1314
*/
1415

1516
import go
1617
import semmle.go.security.SecureCookies
17-
import semmle.go.concepts.HTTP
1818
import SensitiveCookieNameFlow::PathGraph
1919

2020
from

go/ql/src/Security/CWE-614/CookieWithoutSecure.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
* @kind problem
55
* @problem.severity warning
66
* @precision high
7+
* @security-severity 5.0
78
* @id go/cookie-secure-not-set
89
* @tags security
910
* external/cwe/cwe-1004
1011
*/
1112

1213
import go
1314
import semmle.go.security.SecureCookies
14-
import semmle.go.concepts.HTTP
1515

1616
from Http::CookieWrite cw
1717
where isInsecureCookie(cw)
18-
select cw, "Cookie does not set Secure attribute to true"
18+
select cw, "Cookie does not set Secure attribute to true."

0 commit comments

Comments
 (0)