Merge branch 'main' into add-cwe-208

This commit is contained in:
Brandon Stewart
2023-08-11 09:37:16 -04:00
committed by GitHub
145 changed files with 2529 additions and 2576 deletions

View File

@@ -368,20 +368,8 @@ private module Cached {
exists(Scope scope1, CfgScope scope2 |
scope1 = access.getVariable().getDeclaringScope() and
scope2 = access.getCfgScope() and
scope1 != scope2
|
if access instanceof SelfVariableAccess
then
// ```
// class C
// def self.m // not a captured access
// end
//
// self.foo // not a captured access
// end
// ```
not scope2 instanceof Toplevel
else any()
scope1 != scope2 and
not scope2 instanceof Toplevel
)
}

View File

@@ -116,3 +116,13 @@ splat_followed_by_keyword_param(taint(58), taint(59), c: taint(60))
x = []
x[some_index()] = taint(61)
positional(*x)
def destruct((a,b), (c,(d,e)))
sink a # $ MISSING: hasValueFlow=62
sink b # $ MISSING: hasValueFlow=63
sink c # $ MISSING: hasValueFlow=64
sink d
sink e # $ MISSING: hasValueFlow=65
end
destruct([taint(62), taint(63)], [taint(64), [0, taint(65)]])

View File

@@ -103,13 +103,9 @@ definition
| scopes.rb:26:1:26:12 | self (A) | scopes.rb:26:1:26:12 | self |
| scopes.rb:27:1:27:1 | x | scopes.rb:27:1:27:1 | x |
| scopes.rb:28:1:30:3 | self (B) | scopes.rb:28:1:30:3 | self |
| scopes.rb:29:3:29:3 | x | scopes.rb:29:3:29:3 | x |
| scopes.rb:32:3:32:3 | x | scopes.rb:32:3:32:3 | x |
| scopes.rb:34:1:36:3 | self (C) | scopes.rb:34:1:36:3 | self |
| scopes.rb:35:3:35:3 | x | scopes.rb:35:3:35:3 | x |
| scopes.rb:41:1:49:3 | self (M) | scopes.rb:41:1:49:3 | self |
| scopes.rb:42:2:42:4 | var | scopes.rb:42:2:42:4 | var |
| scopes.rb:43:2:43:4 | foo | scopes.rb:43:2:43:4 | foo |
| scopes.rb:46:5:46:8 | var2 | scopes.rb:46:5:46:8 | var2 |
| ssa.rb:1:1:16:3 | self (m) | ssa.rb:1:1:16:3 | self |
| ssa.rb:1:7:1:7 | b | ssa.rb:1:7:1:7 | b |

View File

@@ -619,18 +619,8 @@ readAccess
captureAccess
| instance_variables.rb:28:3:28:4 | self |
| instance_variables.rb:32:12:32:13 | self |
| nested_scopes.rb:5:3:5:3 | a |
| nested_scopes.rb:7:5:7:5 | a |
| nested_scopes.rb:9:7:9:7 | a |
| nested_scopes.rb:11:9:11:9 | a |
| nested_scopes.rb:18:29:18:34 | self |
| nested_scopes.rb:18:34:18:34 | a |
| nested_scopes.rb:25:14:25:14 | a |
| nested_scopes.rb:31:11:31:11 | a |
| nested_scopes.rb:32:16:32:16 | a |
| nested_scopes.rb:34:12:34:12 | a |
| nested_scopes.rb:36:10:36:10 | a |
| nested_scopes.rb:38:8:38:8 | a |
| parameters.rb:3:4:3:9 | self |
| parameters.rb:4:4:4:9 | self |
| parameters.rb:17:5:17:28 | self |
@@ -653,14 +643,6 @@ captureAccess
| scopes.rb:15:4:15:9 | self |
| scopes.rb:16:4:16:9 | self |
| scopes.rb:17:4:17:9 | self |
| scopes.rb:29:3:29:3 | x |
| scopes.rb:32:3:32:3 | x |
| scopes.rb:35:3:35:3 | x |
| scopes.rb:42:2:42:4 | var |
| scopes.rb:43:2:43:4 | foo |
| scopes.rb:44:5:44:7 | var |
| scopes.rb:46:5:46:8 | var2 |
| scopes.rb:47:5:47:8 | var2 |
| ssa.rb:26:7:26:10 | elem |
| ssa.rb:27:5:27:13 | self |
| ssa.rb:27:10:27:13 | elem |