File tree Expand file tree Collapse file tree 4 files changed +16
-0
lines changed
test/query-tests/Security/CWE-020 Expand file tree Collapse file tree 4 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ category : minorAnalysis
3+ ---
4+ * Calls to ` sinon.match() ` are no longer incorrectly identified as regular expression operations.
Original file line number Diff line number Diff line change @@ -998,6 +998,8 @@ private predicate isUsedAsNonMatchObject(DataFlow::MethodCallNode call) {
998998 or
999999 // Result is obviously unused
10001000 call .asExpr ( ) = any ( ExprStmt stmt ) .getExpr ( )
1001+ or
1002+ call = API:: moduleImport ( "sinon" ) .getMember ( "match" ) .getACall ( )
10011003 )
10021004}
10031005
Original file line number Diff line number Diff line change 6060 / ^ ( f o o .e x a m p l e \. c o m | w h a t e v e r ) $ / ; // $ Alert (but kinda OK - one disjunction doesn't even look like a hostname)
6161
6262 if ( s . matchAll ( "^http://test.example.com" ) ) { } // $ Alert
63+
64+ const sinon = require ( 'sinon' ) ;
65+ const megacliteUrl = "https://a.b.com" ;
66+ sinon . assert . calledWith ( postStub . firstCall , sinon . match ( megacliteUrl ) ) ;
6367} ) ;
Original file line number Diff line number Diff line change 1+ const sinon = require ( 'sinon' ) ;
2+
3+ function testFunction ( ) {
4+ const megacliteUrl = "https://a.b.com" ;
5+ sinon . assert . calledWith ( postStub . firstCall , sinon . match ( megacliteUrl ) ) ;
6+ }
You can’t perform that action at this time.
0 commit comments