File tree Expand file tree Collapse file tree 7 files changed +28
-132
lines changed
javascript/ql/src/experimental/Security/CWE-347-noVerification Expand file tree Collapse file tree 7 files changed +28
-132
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,18 @@ DataFlow::Node unverifiedDecode() {
1212 .mayHaveStringValue ( "none" ) and
1313 result = verify .getParameter ( 0 ) .asSink ( )
1414 )
15+ or
16+ // jwt-simple
17+ exists ( API:: Node n | n = API:: moduleImport ( "jwt-simple" ) .getMember ( "decode" ) |
18+ n .getParameter ( 2 ) .asSink ( ) .asExpr ( ) = any ( BoolLiteral b | b .getBoolValue ( ) = true ) and
19+ result = n .getParameter ( 0 ) .asSink ( )
20+ )
21+ or
22+ // jwt-decode
23+ result = API:: moduleImport ( "jwt-decode" ) .getParameter ( 0 ) .asSink ( )
24+ or
25+ //jose
26+ result = API:: moduleImport ( "jose" ) .getMember ( "decodeJwt" ) .getParameter ( 0 ) .asSink ( )
1527}
1628
1729DataFlow:: Node verifiedDecode ( ) {
@@ -27,4 +39,16 @@ DataFlow::Node verifiedDecode() {
2739 ) and
2840 result = verify .getParameter ( 0 ) .asSink ( )
2941 )
30- }
42+ or
43+ // jwt-simple
44+ exists ( API:: Node n | n = API:: moduleImport ( "jwt-simple" ) .getMember ( "decode" ) |
45+ (
46+ n .getParameter ( 2 ) .asSink ( ) .asExpr ( ) = any ( BoolLiteral b | b .getBoolValue ( ) = false ) or
47+ not exists ( n .getParameter ( 2 ) )
48+ ) and
49+ result = n .getParameter ( 0 ) .asSink ( )
50+ or
51+ //jose
52+ result = API:: moduleImport ( "jose" ) .getMember ( "jwtVerify" ) .getParameter ( 0 ) .asSink ( )
53+ )
54+ }
Original file line number Diff line number Diff line change 1212
1313import javascript
1414import DataFlow:: PathGraph
15- import jsonWebToken
15+ import JWT
1616
1717class Configuration extends TaintTracking:: Configuration {
1818 Configuration ( ) { this = "jsonwebtoken without any signature verification" }
Original file line number Diff line number Diff line change 1212
1313import javascript
1414import DataFlow:: PathGraph
15- import jsonWebToken
15+ import JWT
1616
1717class Configuration extends TaintTracking:: Configuration {
1818 Configuration ( ) { this = "jsonwebtoken without any signature verification" }
Original file line number Diff line number Diff line change 1212
1313import javascript
1414import DataFlow:: PathGraph
15- import jsonWebToken
15+ import JWT
1616
1717class ConfigurationUnverifiedDecode extends TaintTracking:: Configuration {
1818 ConfigurationUnverifiedDecode ( ) { this = "jsonwebtoken without any signature verification" }
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments