File tree Expand file tree Collapse file tree
test/query-tests/Security/CWE-798 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,18 +22,11 @@ where
2222 // use source value in message if it's available
2323 if source .getNode ( ) .asExpr ( ) instanceof ConstantString
2424 then
25- exists ( string val , Sink sinkNode |
26- sinkNode = sink .getNode ( ) .( Sink ) and
27- val = source .getNode ( ) .getStringValue ( )
28- |
29- (
30- (
31- sinkNode .( DefaultCredentialsSink ) .getKind ( ) = "password" or
32- sinkNode .( DefaultCredentialsSink ) .getKind ( ) = "key"
33- )
34- implies
35- // exclude dummy passwords
36- not PasswordHeuristics:: isDummyPassword ( val )
25+ exists ( string val | val = source .getNode ( ) .getStringValue ( ) |
26+ // exclude dummy passwords
27+ not (
28+ sink .getNode ( ) .( Sink ) .( DefaultCredentialsSink ) .getKind ( ) = "password" and
29+ PasswordHeuristics:: isDummyPassword ( val )
3730 ) and
3831 value = "The hard-coded value \"" + val + "\""
3932 )
Original file line number Diff line number Diff line change 5252| HardcodedCredentials.js:131:52:131:61 | 'abcdefgh' |
5353| HardcodedCredentials.js:135:41:135:50 | "abcdefgh" |
5454| HardcodedCredentials.js:160:38:160:48 | "change_me" |
55+ | HardcodedCredentials.js:161:41:161:51 | 'change_me' |
56+ | HardcodedCredentials.js:164:35:164:45 | 'change_me' |
5557edges
5658| HardcodedCredentials.js:18:16:18:30 | "user:abcdefgh" | HardcodedCredentials.js:20:36:20:51 | getCredentials() |
5759#select
@@ -106,3 +108,5 @@ edges
106108| HardcodedCredentials.js:130:44:130:53 | 'abcdefgh' | HardcodedCredentials.js:130:44:130:53 | 'abcdefgh' | HardcodedCredentials.js:130:44:130:53 | 'abcdefgh' | The hard-coded value "abcdefgh" is used as $@. | HardcodedCredentials.js:130:44:130:53 | 'abcdefgh' | key |
107109| HardcodedCredentials.js:131:52:131:61 | 'abcdefgh' | HardcodedCredentials.js:131:52:131:61 | 'abcdefgh' | HardcodedCredentials.js:131:52:131:61 | 'abcdefgh' | The hard-coded value "abcdefgh" is used as $@. | HardcodedCredentials.js:131:52:131:61 | 'abcdefgh' | key |
108110| HardcodedCredentials.js:135:41:135:50 | "abcdefgh" | HardcodedCredentials.js:135:41:135:50 | "abcdefgh" | HardcodedCredentials.js:135:41:135:50 | "abcdefgh" | The hard-coded value "abcdefgh" is used as $@. | HardcodedCredentials.js:135:41:135:50 | "abcdefgh" | key |
111+ | HardcodedCredentials.js:160:38:160:48 | "change_me" | HardcodedCredentials.js:160:38:160:48 | "change_me" | HardcodedCredentials.js:160:38:160:48 | "change_me" | The hard-coded value "change_me" is used as $@. | HardcodedCredentials.js:160:38:160:48 | "change_me" | key |
112+ | HardcodedCredentials.js:161:41:161:51 | 'change_me' | HardcodedCredentials.js:161:41:161:51 | 'change_me' | HardcodedCredentials.js:161:41:161:51 | 'change_me' | The hard-coded value "change_me" is used as $@. | HardcodedCredentials.js:161:41:161:51 | 'change_me' | key |
Original file line number Diff line number Diff line change 157157} ) ( ) ;
158158
159159( function ( ) {
160- require ( "cookie-session" ) ( { secret : "change_me" } ) ;
160+ require ( "cookie-session" ) ( { secret : "change_me" } ) ; // NOT OK
161+ require ( 'crypto' ) . createHmac ( 'sha256' , 'change_me' ) ; // NOT OK
162+
163+ var basicAuth = require ( 'express-basic-auth' ) ;
164+ basicAuth ( { users : { [ adminName ] : 'change_me' } } ) ; // OK
161165} ) ( ) ;
You can’t perform that action at this time.
0 commit comments