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 {
3838 DocumentUrl ( ) { this = "document.url" }
3939 }
4040
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 ( ) }
4451
4552 override DataFlow:: FlowLabel getAFlowLabel ( ) {
4653 if this .( ClientSideRemoteFlowSource ) .getKind ( ) .isUrl ( )
Original file line number Diff line number Diff line change @@ -25,9 +25,16 @@ module CommandInjection {
2525 */
2626 abstract class Sanitizer extends DataFlow:: Node { }
2727
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 }
3138
3239 override string getSourceType ( ) { result = "a user-provided value" }
3340 }
Original file line number Diff line number Diff line change @@ -27,9 +27,16 @@ module CorsMisconfigurationForCredentials {
2727 */
2828 abstract class Sanitizer extends DataFlow:: Node { }
2929
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 }
3340 }
3441
3542 /**
Original file line number Diff line number Diff line change @@ -26,11 +26,15 @@ module RegExpInjection {
2626 abstract class Sanitizer extends DataFlow:: Node { }
2727
2828 /**
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.
3135 */
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 }
3438 }
3539
3640 private import IndirectCommandInjectionCustomizations
Original file line number Diff line number Diff line change @@ -39,9 +39,18 @@ module RequestForgery {
3939 */
4040 abstract class Sanitizer extends DataFlow:: Node { }
4141
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+ }
4554
4655 override predicate isServerSide ( ) { not this instanceof ClientSideRemoteFlowSource }
4756 }
Original file line number Diff line number Diff line change @@ -31,9 +31,16 @@ module ResourceExhaustion {
3131 */
3232 abstract class Sanitizer extends DataFlow:: Node { }
3333
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 ( ) {
3744 // exclude source that only happen client-side
3845 not this instanceof ClientSideRemoteFlowSource and
3946 not this = DataFlow:: parameterNode ( any ( PostMessageEventHandler pmeh ) .getEventParameter ( ) )
Original file line number Diff line number Diff line change @@ -572,16 +572,15 @@ module TaintedPath {
572572 }
573573
574574 /**
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 }
585584 }
586585
587586 /**
Original file line number Diff line number Diff line change @@ -25,9 +25,16 @@ module CorsPermissiveConfiguration {
2525 */
2626 abstract class Sanitizer extends DataFlow:: Node { }
2727
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 }
3138 }
3239
3340 /** A flow label representing `true` and `null` values. */
You can’t perform that action at this time.
0 commit comments