File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
test/query-tests/security/cwe-094/UnsafeCodeConstruction/impl Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,10 @@ module UnsafeCodeConstruction {
19
19
20
20
/** An input parameter to a gem seen as a source. */
21
21
private class LibraryInputAsSource extends Source instanceof DataFlow:: ParameterNode {
22
- LibraryInputAsSource ( ) { this = Gem:: getALibraryInput ( ) }
22
+ LibraryInputAsSource ( ) {
23
+ this = Gem:: getALibraryInput ( ) and
24
+ not this .getName ( ) = "code"
25
+ }
23
26
}
24
27
25
28
/** A sink for code constructed from library input vulnerabilities. */
Original file line number Diff line number Diff line change @@ -20,4 +20,8 @@ def indirect_eval(x)
20
20
def send_stuff ( x )
21
21
foo . send ( "foo_#{ x } " ) # OK - attacker cannot control entire string.
22
22
end
23
+
24
+ def named_code ( code )
25
+ foo . send ( "def \n #{ code } \n end" ) # OK - parameter is named code
26
+ end
23
27
end
You can’t perform that action at this time.
0 commit comments