Skip to content

Commit 55705d4

Browse files
owen-mcCopilot
andcommitted
Use instanceof for threat model sources
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 449d672 commit 55705d4

19 files changed

Lines changed: 57 additions & 76 deletions

‎python/ql/lib/semmle/python/security/dataflow/CodeInjectionCustomizations.qll‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,9 @@ module CodeInjection {
3737
*/
3838
deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource;
3939

40-
/**
41-
* An active threat-model source, considered as a flow source.
42-
*/
43-
private class ActiveThreatModelSourceAsSource extends Source, ActiveThreatModelSource { }
40+
/** An active threat-model source, considered as a flow source. */
41+
private class ActiveThreatModelSourceAsSource extends Source instanceof ActiveThreatModelSource {
42+
}
4443

4544
/**
4645
* A code execution, considered as a flow sink.

‎python/ql/lib/semmle/python/security/dataflow/CommandInjectionCustomizations.qll‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,9 @@ module CommandInjection {
3737
*/
3838
deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource;
3939

40-
/**
41-
* An active threat-model source, considered as a flow source.
42-
*/
43-
private class ActiveThreatModelSourceAsSource extends Source, ActiveThreatModelSource { }
40+
/** An active threat-model source, considered as a flow source. */
41+
private class ActiveThreatModelSourceAsSource extends Source instanceof ActiveThreatModelSource {
42+
}
4443

4544
/**
4645
* A command execution, considered as a flow sink.

‎python/ql/lib/semmle/python/security/dataflow/CookieInjectionCustomizations.qll‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,9 @@ module CookieInjection {
3535
*/
3636
deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource;
3737

38-
/**
39-
* An active threat-model source, considered as a flow source.
40-
*/
41-
private class ActiveThreatModelSourceAsSource extends Source, ActiveThreatModelSource { }
38+
/** An active threat-model source, considered as a flow source. */
39+
private class ActiveThreatModelSourceAsSource extends Source instanceof ActiveThreatModelSource {
40+
}
4241

4342
/**
4443
* A write to a cookie, considered as a sink.

‎python/ql/lib/semmle/python/security/dataflow/HttpHeaderInjectionCustomizations.qll‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,9 @@ module HttpHeaderInjection {
3636
*/
3737
deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource;
3838

39-
/**
40-
* An active threat-model source, considered as a flow source.
41-
*/
42-
private class ActiveThreatModelSourceAsSource extends Source, ActiveThreatModelSource { }
39+
/** An active threat-model source, considered as a flow source. */
40+
private class ActiveThreatModelSourceAsSource extends Source instanceof ActiveThreatModelSource {
41+
}
4342

4443
/**
4544
* A HTTP header write, considered as a flow sink.

‎python/ql/lib/semmle/python/security/dataflow/LdapInjectionCustomizations.qll‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,9 @@ module LdapInjection {
4646
*/
4747
deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource;
4848

49-
/**
50-
* An active threat-model source, considered as a flow source.
51-
*/
52-
private class ActiveThreatModelSourceAsSource extends Source, ActiveThreatModelSource { }
49+
/** An active threat-model source, considered as a flow source. */
50+
private class ActiveThreatModelSourceAsSource extends Source instanceof ActiveThreatModelSource {
51+
}
5352

5453
/**
5554
* A logging operation, considered as a flow sink.

‎python/ql/lib/semmle/python/security/dataflow/LogInjectionCustomizations.qll‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,9 @@ module LogInjection {
3737
*/
3838
deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource;
3939

40-
/**
41-
* An active threat-model source, considered as a flow source.
42-
*/
43-
private class ActiveThreatModelSourceAsSource extends Source, ActiveThreatModelSource { }
40+
/** An active threat-model source, considered as a flow source. */
41+
private class ActiveThreatModelSourceAsSource extends Source instanceof ActiveThreatModelSource {
42+
}
4443

4544
/**
4645
* A logging operation, considered as a flow sink.

‎python/ql/lib/semmle/python/security/dataflow/PamAuthorizationCustomizations.qll‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,9 @@ module PamAuthorizationCustomizations {
4444
*/
4545
deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource;
4646

47-
/**
48-
* An active threat-model source, considered as a flow source.
49-
*/
50-
private class ActiveThreatModelSourceAsSource extends Source, ActiveThreatModelSource { }
47+
/** An active threat-model source, considered as a flow source. */
48+
private class ActiveThreatModelSourceAsSource extends Source instanceof ActiveThreatModelSource {
49+
}
5150

5251
/**
5352
* A vulnerable `pam_authenticate` call considered as a flow sink.

‎python/ql/lib/semmle/python/security/dataflow/PathInjectionCustomizations.qll‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,9 @@ module PathInjection {
4747
*/
4848
deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource;
4949

50-
/**
51-
* An active threat-model source, considered as a flow source.
52-
*/
53-
private class ActiveThreatModelSourceAsSource extends Source, ActiveThreatModelSource { }
50+
/** An active threat-model source, considered as a flow source. */
51+
private class ActiveThreatModelSourceAsSource extends Source instanceof ActiveThreatModelSource {
52+
}
5453

5554
/**
5655
* A file system access, considered as a flow sink.

‎python/ql/lib/semmle/python/security/dataflow/PolynomialReDoSCustomizations.qll‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,9 @@ module PolynomialReDoS {
5656
*/
5757
deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource;
5858

59-
/**
60-
* An active threat-model source, considered as a flow source.
61-
*/
62-
private class ActiveThreatModelSourceAsSource extends Source, ActiveThreatModelSource { }
59+
/** An active threat-model source, considered as a flow source. */
60+
private class ActiveThreatModelSourceAsSource extends Source instanceof ActiveThreatModelSource {
61+
}
6362

6463
/**
6564
* A regex execution, considered as a flow sink.

‎python/ql/lib/semmle/python/security/dataflow/ReflectedXSSCustomizations.qll‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,9 @@ module ReflectedXss {
3737
*/
3838
deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource;
3939

40-
/**
41-
* An active threat-model source, considered as a flow source.
42-
*/
43-
private class ActiveThreatModelSourceAsSource extends Source, ActiveThreatModelSource { }
40+
/** An active threat-model source, considered as a flow source. */
41+
private class ActiveThreatModelSourceAsSource extends Source instanceof ActiveThreatModelSource {
42+
}
4443

4544
/**
4645
* A data flow sink for "reflected cross-site scripting" vulnerabilities.

0 commit comments

Comments
 (0)