File tree Expand file tree Collapse file tree 8 files changed +79
-32
lines changed
lib/semmle/javascript/security/dataflow
src/experimental/Security/CWE-942 Expand file tree Collapse file tree 8 files changed +79
-32
lines changed Original file line number Diff line number Diff line change @@ -38,9 +38,16 @@ module ClientSideUrlRedirect {
38
38
DocumentUrl ( ) { this = "document.url" }
39
39
}
40
40
41
- /** A source of remote user input, considered as a flow source for unvalidated URL redirects. */
42
- class RemoteFlowSourceAsSource extends Source instanceof RemoteFlowSource {
43
- RemoteFlowSourceAsSource ( ) { not this .( ClientSideRemoteFlowSource ) .getKind ( ) .isPath ( ) }
41
+ /**
42
+ * DEPRECATED: Use `ActiveThreatModelSource` from Concepts instead!
43
+ */
44
+ deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource ;
45
+
46
+ /**
47
+ * An active threat-model source, considered as a flow source.
48
+ */
49
+ private class ActiveThreatModelSourceAsSource extends Source instanceof ActiveThreatModelSource {
50
+ ActiveThreatModelSourceAsSource ( ) { not this .( ClientSideRemoteFlowSource ) .getKind ( ) .isPath ( ) }
44
51
45
52
override DataFlow:: FlowLabel getAFlowLabel ( ) {
46
53
if this .( ClientSideRemoteFlowSource ) .getKind ( ) .isUrl ( )
Original file line number Diff line number Diff line change @@ -25,9 +25,16 @@ module CommandInjection {
25
25
*/
26
26
abstract class Sanitizer extends DataFlow:: Node { }
27
27
28
- /** A source of remote user input, considered as a flow source for command injection. */
29
- class RemoteFlowSourceAsSource extends Source instanceof RemoteFlowSource {
30
- RemoteFlowSourceAsSource ( ) { not this instanceof ClientSideRemoteFlowSource }
28
+ /**
29
+ * DEPRECATED: Use `ActiveThreatModelSource` from Concepts instead!
30
+ */
31
+ deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource ;
32
+
33
+ /**
34
+ * An active threat-model source, considered as a flow source.
35
+ */
36
+ private class ActiveThreatModelSourceAsSource extends Source instanceof ActiveThreatModelSource {
37
+ ActiveThreatModelSourceAsSource ( ) { not this instanceof ClientSideRemoteFlowSource }
31
38
32
39
override string getSourceType ( ) { result = "a user-provided value" }
33
40
}
Original file line number Diff line number Diff line change @@ -27,9 +27,16 @@ module CorsMisconfigurationForCredentials {
27
27
*/
28
28
abstract class Sanitizer extends DataFlow:: Node { }
29
29
30
- /** A source of remote user input, considered as a flow source for CORS misconfiguration. */
31
- class RemoteFlowSourceAsSource extends Source instanceof RemoteFlowSource {
32
- RemoteFlowSourceAsSource ( ) { not this instanceof ClientSideRemoteFlowSource }
30
+ /**
31
+ * DEPRECATED: Use `ActiveThreatModelSource` from Concepts instead!
32
+ */
33
+ deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource ;
34
+
35
+ /**
36
+ * An active threat-model source, considered as a flow source.
37
+ */
38
+ private class ActiveThreatModelSourceAsSource extends Source instanceof ActiveThreatModelSource {
39
+ ActiveThreatModelSourceAsSource ( ) { not this instanceof ClientSideRemoteFlowSource }
33
40
}
34
41
35
42
/**
Original file line number Diff line number Diff line change @@ -26,11 +26,15 @@ module RegExpInjection {
26
26
abstract class Sanitizer extends DataFlow:: Node { }
27
27
28
28
/**
29
- * A source of remote user input, considered as a flow source for regular
30
- * expression injection.
29
+ * DEPRECATED: Use `ActiveThreatModelSource` from Concepts instead!
30
+ */
31
+ deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource ;
32
+
33
+ /**
34
+ * An active threat-model source, considered as a flow source.
31
35
*/
32
- class RemoteFlowSourceAsSource extends Source instanceof RemoteFlowSource {
33
- RemoteFlowSourceAsSource ( ) { not this instanceof ClientSideRemoteFlowSource }
36
+ private class ActiveThreatModelSourceAsSource extends Source instanceof ActiveThreatModelSource {
37
+ ActiveThreatModelSourceAsSource ( ) { not this instanceof ClientSideRemoteFlowSource }
34
38
}
35
39
36
40
private import IndirectCommandInjectionCustomizations
Original file line number Diff line number Diff line change @@ -39,9 +39,18 @@ module RequestForgery {
39
39
*/
40
40
abstract class Sanitizer extends DataFlow:: Node { }
41
41
42
- /** A source of server-side remote user input, considered as a flow source for request forgery. */
43
- private class RemoteFlowSourceAsSource extends Source instanceof RemoteFlowSource {
44
- RemoteFlowSourceAsSource ( ) { not this .( ClientSideRemoteFlowSource ) .getKind ( ) .isPathOrUrl ( ) }
42
+ /**
43
+ * DEPRECATED: Use `ActiveThreatModelSource` from Concepts instead!
44
+ */
45
+ deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource ;
46
+
47
+ /**
48
+ * An active threat-model source, considered as a flow source.
49
+ */
50
+ private class ActiveThreatModelSourceAsSource extends Source instanceof ActiveThreatModelSource {
51
+ ActiveThreatModelSourceAsSource ( ) {
52
+ not this .( ClientSideRemoteFlowSource ) .getKind ( ) .isPathOrUrl ( )
53
+ }
45
54
46
55
override predicate isServerSide ( ) { not this instanceof ClientSideRemoteFlowSource }
47
56
}
Original file line number Diff line number Diff line change @@ -31,9 +31,16 @@ module ResourceExhaustion {
31
31
*/
32
32
abstract class Sanitizer extends DataFlow:: Node { }
33
33
34
- /** A source of remote user input, considered as a data flow source for resource exhaustion vulnerabilities. */
35
- class RemoteFlowSourceAsSource extends Source instanceof RemoteFlowSource {
36
- RemoteFlowSourceAsSource ( ) {
34
+ /**
35
+ * DEPRECATED: Use `ActiveThreatModelSource` from Concepts instead!
36
+ */
37
+ deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource ;
38
+
39
+ /**
40
+ * An active threat-model source, considered as a flow source.
41
+ */
42
+ private class ActiveThreatModelSourceAsSource extends Source instanceof ActiveThreatModelSource {
43
+ ActiveThreatModelSourceAsSource ( ) {
37
44
// exclude source that only happen client-side
38
45
not this instanceof ClientSideRemoteFlowSource and
39
46
not this = DataFlow:: parameterNode ( any ( PostMessageEventHandler pmeh ) .getEventParameter ( ) )
Original file line number Diff line number Diff line change @@ -572,16 +572,15 @@ module TaintedPath {
572
572
}
573
573
574
574
/**
575
- * A source of remote user input, considered as a flow source for
576
- * tainted-path vulnerabilities.
577
- */
578
- class RemoteFlowSourceAsSource extends Source {
579
- RemoteFlowSourceAsSource ( ) {
580
- exists ( RemoteFlowSource src |
581
- this = src and
582
- not src instanceof ClientSideRemoteFlowSource
583
- )
584
- }
575
+ * DEPRECATED: Use `ActiveThreatModelSource` from Concepts instead!
576
+ */
577
+ deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource ;
578
+
579
+ /**
580
+ * An active threat-model source, considered as a flow source.
581
+ */
582
+ private class ActiveThreatModelSourceAsSource extends Source instanceof ActiveThreatModelSource {
583
+ ActiveThreatModelSourceAsSource ( ) { not this instanceof ClientSideRemoteFlowSource }
585
584
}
586
585
587
586
/**
Original file line number Diff line number Diff line change @@ -25,9 +25,16 @@ module CorsPermissiveConfiguration {
25
25
*/
26
26
abstract class Sanitizer extends DataFlow:: Node { }
27
27
28
- /** A source of remote user input, considered as a flow source for CORS misconfiguration. */
29
- class RemoteFlowSourceAsSource extends Source instanceof RemoteFlowSource {
30
- RemoteFlowSourceAsSource ( ) { not this instanceof ClientSideRemoteFlowSource }
28
+ /**
29
+ * DEPRECATED: Use `ActiveThreatModelSource` from Concepts instead!
30
+ */
31
+ deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource ;
32
+
33
+ /**
34
+ * An active threat-model source, considered as a flow source.
35
+ */
36
+ private class ActiveThreatModelSourceAsSource extends Source instanceof ActiveThreatModelSource {
37
+ ActiveThreatModelSourceAsSource ( ) { not this instanceof ClientSideRemoteFlowSource }
31
38
}
32
39
33
40
/** A flow label representing `true` and `null` values. */
You can’t perform that action at this time.
0 commit comments