Skip to content

Commit 7d73808

Browse files
committed
fix a test mistake, add comments for JWT extension points
1 parent aa127b1 commit 7d73808

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

go/ql/src/experimental/frameworks/JWT.qll

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import go
22

33
/**
4-
* A abstract class which responsible for parsing a JWT token
4+
* A abstract class which responsible for parsing a JWT token.
55
*/
66
abstract class JwtParseBase extends Function {
77
/**
@@ -23,7 +23,9 @@ abstract class JwtParseBase extends Function {
2323
}
2424

2525
/**
26-
* A abstract class which responsible for parsing a JWT token which the key parameter is a function type
26+
* A abstract class which responsible for parsing a JWT token which the key parameter is a function type.
27+
*
28+
* Extends this class for Jwt parsing methods that accepts a function type as key.
2729
*/
2830
abstract class JwtParseWithKeyFunction extends JwtParseBase {
2931
/**
@@ -38,7 +40,9 @@ abstract class JwtParseWithKeyFunction extends JwtParseBase {
3840
}
3941

4042
/**
41-
* A abstract class which responsible for parsing a JWT token which the key parameter can be a string or byte type
43+
* A abstract class which responsible for parsing a JWT token which the key parameter can be a string or byte type.
44+
*
45+
* Extends this class for Jwt parsing methods that accepts a non-function type as key.
4246
*/
4347
abstract class JwtParse extends JwtParseBase {
4448
/**
@@ -54,6 +58,8 @@ abstract class JwtParse extends JwtParseBase {
5458

5559
/**
5660
* A abstract class which responsible for parsing a JWT without verifying it
61+
*
62+
* Extends this class for Jwt parsing methods that don't verify JWT signature
5763
*/
5864
abstract class JwtUnverifiedParse extends JwtParseBase { }
5965

go/ql/test/experimental/CWE-347/NoVerification.expected renamed to go/ql/test/experimental/CWE-347/ParseJWTWithoutVerification.expected

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ edges
44
| go-jose.v3.go:25:16:25:47 | call to Get | go-jose.v3.go:26:15:26:25 | signedToken |
55
| go-jose.v3.go:26:15:26:25 | signedToken | go-jose.v3.go:29:19:29:29 | definition of signedToken |
66
| go-jose.v3.go:29:19:29:29 | definition of signedToken | go-jose.v3.go:31:37:31:47 | signedToken |
7-
| go-jose.v3.go:31:21:31:48 | call to ParseSigned | go-jose.v3.go:33:12:33:23 | DecodedToken |
8-
| go-jose.v3.go:31:37:31:47 | signedToken | go-jose.v3.go:31:21:31:48 | call to ParseSigned |
7+
| go-jose.v3.go:31:2:31:48 | ... := ...[0] | go-jose.v3.go:33:12:33:23 | DecodedToken |
8+
| go-jose.v3.go:31:37:31:47 | signedToken | go-jose.v3.go:31:2:31:48 | ... := ...[0] |
99
| golang-jwt-v5.go:28:16:28:20 | selection of URL | golang-jwt-v5.go:28:16:28:28 | call to Query |
1010
| golang-jwt-v5.go:28:16:28:28 | call to Query | golang-jwt-v5.go:28:16:28:47 | call to Get |
1111
| golang-jwt-v5.go:28:16:28:47 | call to Get | golang-jwt-v5.go:29:25:29:35 | signedToken |
@@ -17,7 +17,7 @@ nodes
1717
| go-jose.v3.go:25:16:25:47 | call to Get | semmle.label | call to Get |
1818
| go-jose.v3.go:26:15:26:25 | signedToken | semmle.label | signedToken |
1919
| go-jose.v3.go:29:19:29:29 | definition of signedToken | semmle.label | definition of signedToken |
20-
| go-jose.v3.go:31:21:31:48 | call to ParseSigned | semmle.label | call to ParseSigned |
20+
| go-jose.v3.go:31:2:31:48 | ... := ...[0] | semmle.label | ... := ...[0] |
2121
| go-jose.v3.go:31:37:31:47 | signedToken | semmle.label | signedToken |
2222
| go-jose.v3.go:33:12:33:23 | DecodedToken | semmle.label | DecodedToken |
2323
| golang-jwt-v5.go:28:16:28:20 | selection of URL | semmle.label | selection of URL |

0 commit comments

Comments
 (0)