Skip to content

Commit 8b2accc

Browse files
committed
Add fixes and suggestions
1 parent d8aa0e2 commit 8b2accc

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

ruby/ql/lib/codeql/ruby/security/InsecureRandomnessCustomizations.qll

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* Provides default sources, sinks, and sanitizers for reasoning about bypass of
3-
* sensitive action guards, as well as extension points for adding your own.
2+
* Provides default sources, sinks, and sanitizers for reasoning about random values that
3+
* are not cryptographically secure, as well as extension points for adding your own.
44
*/
55

66
private import codeql.ruby.CFG
@@ -9,10 +9,11 @@ private import codeql.ruby.DataFlow
99
private import codeql.ruby.security.SensitiveActions
1010
private import codeql.ruby.Concepts
1111
private import codeql.ruby.ApiGraphs
12+
import codeql.ruby.frameworks.core.Kernel
1213

1314
/**
14-
* Provides default sources, sinks, and sanitizers for reasoning about bypass of
15-
* sensitive action guards, as well as extension points for adding your own.
15+
* Provides default sources, sinks, and sanitizers for reasoning about random values that
16+
* are not cryptographically secure, as well as extension points for adding your own.
1617
*/
1718
module InsecureRandomness {
1819
/**
@@ -42,6 +43,7 @@ module InsecureRandomness {
4243
this.getReceiver().asExpr().getExpr() instanceof SelfVariableAccess and
4344
super.getMethodName() = "rand"
4445
)
46+
or this.(Kernel::KernelMethodCall).getMethodName() = "rand"
4547
}
4648
}
4749

ruby/ql/lib/codeql/ruby/security/InsecureRandomnessQuery.qll

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,6 @@ private import codeql.ruby.DataFlow
77
private import codeql.ruby.TaintTracking
88
import InsecureRandomnessCustomizations::InsecureRandomness
99

10-
/**
11-
* A taint-tracking configuration for detecting Insecure Randomness vulnerabilities.
12-
* DEPRECATED: Use `InsecureRandomnessFlow`
13-
*/
14-
deprecated class Configuration extends TaintTracking::Configuration {
15-
Configuration() { this = "InsecureRandomnessConfiguration" }
16-
17-
override predicate isSource(DataFlow::Node source) { source instanceof Source }
18-
19-
override predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
20-
21-
override predicate isSanitizer(DataFlow::Node node) { node instanceof Sanitizer }
22-
}
23-
2410
private module InsecureRandomnessConfig implements DataFlow::ConfigSig {
2511
predicate isSource(DataFlow::Node source) { source instanceof Source }
2612

0 commit comments

Comments
 (0)