1- /** Provides classes and predicates for reasoning about weak randomness. */
1+ /** Provides classes and predicates for reasoning about insecure randomness. */
22
33import java
44private import semmle.code.java.frameworks.Servlets
@@ -9,13 +9,13 @@ private import semmle.code.java.dataflow.ExternalFlow
99private import semmle.code.java.security.RandomQuery
1010
1111/**
12- * A node representing a source of weak randomness.
12+ * A node representing a source of insecure randomness.
1313 *
1414 * For example, use of `java.util.Random` or `java.lang.Math.random`.
1515 */
16- abstract class WeakRandomnessSource extends DataFlow:: Node { }
16+ abstract class InsecureRandomnessSource extends DataFlow:: Node { }
1717
18- private class RandomMethodSource extends WeakRandomnessSource {
18+ private class RandomMethodSource extends InsecureRandomnessSource {
1919 RandomMethodSource ( ) {
2020 exists ( RandomDataSource s | this .asExpr ( ) = s .getOutput ( ) |
2121 not s .getQualifier ( ) .getType ( ) instanceof SafeRandomImplementation
@@ -40,14 +40,14 @@ private class TypeHadoopOsSecureRandom extends SafeRandomImplementation {
4040}
4141
4242/**
43- * A node representing an operation which should not use a weakly random value.
43+ * A node representing an operation which should not use a Insecurely random value.
4444 */
45- abstract class WeakRandomnessSink extends DataFlow:: Node { }
45+ abstract class InsecureRandomnessSink extends DataFlow:: Node { }
4646
4747/**
4848 * A node which sets the value of a cookie.
4949 */
50- private class CookieSink extends WeakRandomnessSink {
50+ private class CookieSink extends InsecureRandomnessSink {
5151 CookieSink ( ) {
5252 exists ( Call c |
5353 c .( ClassInstanceExpr ) .getConstructedType ( ) instanceof TypeCookie and
@@ -60,19 +60,19 @@ private class CookieSink extends WeakRandomnessSink {
6060 }
6161}
6262
63- private class SensitiveActionSink extends WeakRandomnessSink {
63+ private class SensitiveActionSink extends InsecureRandomnessSink {
6464 SensitiveActionSink ( ) { this .asExpr ( ) instanceof SensitiveExpr }
6565}
6666
67- private class CredentialsSink extends WeakRandomnessSink instanceof CredentialsSinkNode { }
67+ private class CredentialsSink extends InsecureRandomnessSink instanceof CredentialsSinkNode { }
6868
6969/**
70- * A taint-tracking configuration for weak randomness.
70+ * A taint-tracking configuration for Insecure randomness.
7171 */
72- module WeakRandomnessConfig implements DataFlow:: ConfigSig {
73- predicate isSource ( DataFlow:: Node src ) { src instanceof WeakRandomnessSource }
72+ module InsecureRandomnessConfig implements DataFlow:: ConfigSig {
73+ predicate isSource ( DataFlow:: Node src ) { src instanceof InsecureRandomnessSource }
7474
75- predicate isSink ( DataFlow:: Node sink ) { sink instanceof WeakRandomnessSink }
75+ predicate isSink ( DataFlow:: Node sink ) { sink instanceof InsecureRandomnessSink }
7676
7777 predicate isBarrierIn ( DataFlow:: Node n ) { isSource ( n ) }
7878
@@ -92,6 +92,6 @@ module WeakRandomnessConfig implements DataFlow::ConfigSig {
9292}
9393
9494/**
95- * Taint-tracking flow of a weakly random value into a sensitive sink.
95+ * Taint-tracking flow of a Insecurely random value into a sensitive sink.
9696 */
97- module WeakRandomnessFlow = TaintTracking:: Global< WeakRandomnessConfig > ;
97+ module InsecureRandomnessFlow = TaintTracking:: Global< InsecureRandomnessConfig > ;
0 commit comments