diff --git a/python/ql/lib/change-notes/2026-11-18-outdated-deprecations.md b/python/ql/lib/change-notes/2026-11-18-outdated-deprecations.md new file mode 100644 index 000000000000..430bea886a3e --- /dev/null +++ b/python/ql/lib/change-notes/2026-11-18-outdated-deprecations.md @@ -0,0 +1,4 @@ +--- +category: breaking +--- +* Removed deprecated aliases and predicates from the AST, API-graph, data-flow, type-tracking, and security libraries. diff --git a/python/ql/lib/semmle/python/ApiGraphs.qll b/python/ql/lib/semmle/python/ApiGraphs.qll index efd8141efc6e..14b1e13680eb 100644 --- a/python/ql/lib/semmle/python/ApiGraphs.qll +++ b/python/ql/lib/semmle/python/ApiGraphs.qll @@ -344,28 +344,6 @@ module API { /** Gets the location of this node */ PY::Location getLocation() { result = this.getInducingNode().getLocation() } - /** - * Holds if this element is at the specified location. - * The location spans column `startcolumn` of line `startline` to - * column `endcolumn` of line `endline` in file `filepath`. - * For more information, see - * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). - */ - deprecated predicate hasLocationInfo( - string filepath, int startline, int startcolumn, int endline, int endcolumn - ) { - this.getInducingNode().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn) - or - // For nodes that do not have a meaningful location, `path` is the empty string and all other - // parameters are zero. - not exists(this.getInducingNode()) and - filepath = "" and - startline = 0 and - startcolumn = 0 and - endline = 0 and - endcolumn = 0 - } - /** * Gets a textual representation of this element. */ diff --git a/python/ql/lib/semmle/python/Exprs.qll b/python/ql/lib/semmle/python/Exprs.qll index 1d4b545909ae..2dbc03293e29 100644 --- a/python/ql/lib/semmle/python/Exprs.qll +++ b/python/ql/lib/semmle/python/Exprs.qll @@ -527,12 +527,6 @@ private string non_byte_prefix() { not result.charAt(_) in ["b", "B"] } -/** DEPRECATED. Use `StringLiteral` instead. */ -deprecated class Str = StringLiteral; - -/** DEPRECATED. Use `StringLiteral` instead. */ -deprecated class StrConst = StringLiteral; - /** A string constant. */ class StringLiteral extends Str_, ImmutableLiteral { /* syntax: "hello" */ diff --git a/python/ql/lib/semmle/python/dataflow/new/BarrierGuards.qll b/python/ql/lib/semmle/python/dataflow/new/BarrierGuards.qll index 072098991bb4..cae8924dbe07 100644 --- a/python/ql/lib/semmle/python/dataflow/new/BarrierGuards.qll +++ b/python/ql/lib/semmle/python/dataflow/new/BarrierGuards.qll @@ -48,6 +48,3 @@ private predicate constCompare(DataFlow::GuardNode g, ControlFlowNode node, bool class ConstCompareBarrier extends DataFlow::Node { ConstCompareBarrier() { this = DataFlow::BarrierGuard::getABarrierNode() } } - -/** DEPRECATED: Use ConstCompareBarrier instead. */ -deprecated class StringConstCompareBarrier = ConstCompareBarrier; diff --git a/python/ql/lib/semmle/python/dataflow/new/FlowSummary.qll b/python/ql/lib/semmle/python/dataflow/new/FlowSummary.qll index f9a951241875..a76d5685d6db 100644 --- a/python/ql/lib/semmle/python/dataflow/new/FlowSummary.qll +++ b/python/ql/lib/semmle/python/dataflow/new/FlowSummary.qll @@ -13,15 +13,6 @@ private module Summaries { private import semmle.python.frameworks.data.ModelsAsData } -deprecated class SummaryComponent = Impl::Private::SummaryComponent; - -/** Provides predicates for constructing summary components. */ -deprecated module SummaryComponent = Impl::Private::SummaryComponent; - -deprecated class SummaryComponentStack = Impl::Private::SummaryComponentStack; - -deprecated module SummaryComponentStack = Impl::Private::SummaryComponentStack; - class Provenance = Impl::Public::Provenance; /** Provides the `Range` class used to define the extent of `SummarizedCallable`. */ @@ -57,5 +48,3 @@ final private class SummarizedCallableFinal = SummarizedCallable::Range; final class SummarizedCallable extends SummarizedCallableFinal, Impl::Public::RelevantSummarizedCallable { } - -deprecated class RequiredSummaryComponentStack = Impl::Private::RequiredSummaryComponentStack; diff --git a/python/ql/lib/semmle/python/dataflow/new/TypeTracking.qll b/python/ql/lib/semmle/python/dataflow/new/TypeTracking.qll index 9d21be852fdc..e624584fa06d 100644 --- a/python/ql/lib/semmle/python/dataflow/new/TypeTracking.qll +++ b/python/ql/lib/semmle/python/dataflow/new/TypeTracking.qll @@ -8,13 +8,6 @@ private import semmle.python.Files import Impl::Shared::TypeTracking private import semmle.python.dataflow.new.internal.DataFlowPublic as DataFlowPublic -/** - * DEPRECATED. - * - * A string that may appear as the name of an attribute or access path. - */ -deprecated class AttributeName = Impl::TypeTrackingInput::Content; - /** * A summary of the steps needed to track a value to a given dataflow node. * diff --git a/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowPublic.qll b/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowPublic.qll index 8ee269cab34e..981ed396ff17 100644 --- a/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowPublic.qll +++ b/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowPublic.qll @@ -179,20 +179,6 @@ class Node extends TNode { cached Location getLocation() { none() } - /** - * Holds if this element is at the specified location. - * The location spans column `startcolumn` of line `startline` to - * column `endcolumn` of line `endline` in file `filepath`. - * For more information, see - * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). - */ - deprecated predicate hasLocationInfo( - string filepath, int startline, int startcolumn, int endline, int endcolumn - ) { - Stages::DataFlow::ref() and - this.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn) - } - /** Gets the control-flow node corresponding to this node, if any. */ ControlFlowNode asCfgNode() { none() } diff --git a/python/ql/lib/semmle/python/security/dataflow/CodeInjectionCustomizations.qll b/python/ql/lib/semmle/python/security/dataflow/CodeInjectionCustomizations.qll index 87e95d8a5542..e83c367299fb 100644 --- a/python/ql/lib/semmle/python/security/dataflow/CodeInjectionCustomizations.qll +++ b/python/ql/lib/semmle/python/security/dataflow/CodeInjectionCustomizations.qll @@ -32,11 +32,6 @@ module CodeInjection { */ abstract class Sanitizer extends DataFlow::Node { } - /** - * DEPRECATED: Use `ActiveThreatModelSource` from Concepts instead! - */ - deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource; - /** An active threat-model source, considered as a flow source. */ private class ActiveThreatModelSourceAsSource extends Source instanceof ActiveThreatModelSource { } @@ -57,9 +52,6 @@ module CodeInjection { */ class ConstCompareAsSanitizerGuard extends Sanitizer, ConstCompareBarrier { } - /** DEPRECATED: Use ConstCompareAsSanitizerGuard instead. */ - deprecated class StringConstCompareAsSanitizerGuard = ConstCompareAsSanitizerGuard; - /** * A sanitizer defined via models-as-data with kind "code-injection". */ diff --git a/python/ql/lib/semmle/python/security/dataflow/CommandInjectionCustomizations.qll b/python/ql/lib/semmle/python/security/dataflow/CommandInjectionCustomizations.qll index 755a02b0efc2..e8dd872ba81d 100644 --- a/python/ql/lib/semmle/python/security/dataflow/CommandInjectionCustomizations.qll +++ b/python/ql/lib/semmle/python/security/dataflow/CommandInjectionCustomizations.qll @@ -32,11 +32,6 @@ module CommandInjection { */ abstract class Sanitizer extends DataFlow::Node { } - /** - * DEPRECATED: Use `ActiveThreatModelSource` from Concepts instead! - */ - deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource; - /** An active threat-model source, considered as a flow source. */ private class ActiveThreatModelSourceAsSource extends Source instanceof ActiveThreatModelSource { } @@ -92,9 +87,6 @@ module CommandInjection { */ class ConstCompareAsSanitizerGuard extends Sanitizer, ConstCompareBarrier { } - /** DEPRECATED: Use ConstCompareAsSanitizerGuard instead. */ - deprecated class StringConstCompareAsSanitizerGuard = ConstCompareAsSanitizerGuard; - /** * A sanitizer defined via models-as-data with kind "command-injection". */ diff --git a/python/ql/lib/semmle/python/security/dataflow/CookieInjectionCustomizations.qll b/python/ql/lib/semmle/python/security/dataflow/CookieInjectionCustomizations.qll index ba5499d10ee2..6ad0b7e70968 100644 --- a/python/ql/lib/semmle/python/security/dataflow/CookieInjectionCustomizations.qll +++ b/python/ql/lib/semmle/python/security/dataflow/CookieInjectionCustomizations.qll @@ -30,11 +30,6 @@ module CookieInjection { */ abstract class Sanitizer extends DataFlow::Node { } - /** - * DEPRECATED: Use `ActiveThreatModelSource` from Concepts instead! - */ - deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource; - /** An active threat-model source, considered as a flow source. */ private class ActiveThreatModelSourceAsSource extends Source instanceof ActiveThreatModelSource { } diff --git a/python/ql/lib/semmle/python/security/dataflow/HttpHeaderInjectionCustomizations.qll b/python/ql/lib/semmle/python/security/dataflow/HttpHeaderInjectionCustomizations.qll index cd651e0b1a88..5c0ac204ec11 100644 --- a/python/ql/lib/semmle/python/security/dataflow/HttpHeaderInjectionCustomizations.qll +++ b/python/ql/lib/semmle/python/security/dataflow/HttpHeaderInjectionCustomizations.qll @@ -31,11 +31,6 @@ module HttpHeaderInjection { */ abstract class Sanitizer extends DataFlow::Node { } - /** - * DEPRECATED: Use `ActiveThreatModelSource` from Concepts instead! - */ - deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource; - /** An active threat-model source, considered as a flow source. */ private class ActiveThreatModelSourceAsSource extends Source instanceof ActiveThreatModelSource { } diff --git a/python/ql/lib/semmle/python/security/dataflow/LdapInjectionCustomizations.qll b/python/ql/lib/semmle/python/security/dataflow/LdapInjectionCustomizations.qll index d69fe08308e1..6ab2b483e2af 100644 --- a/python/ql/lib/semmle/python/security/dataflow/LdapInjectionCustomizations.qll +++ b/python/ql/lib/semmle/python/security/dataflow/LdapInjectionCustomizations.qll @@ -41,11 +41,6 @@ module LdapInjection { */ abstract class FilterSanitizer extends DataFlow::Node { } - /** - * DEPRECATED: Use `ActiveThreatModelSource` from Concepts instead! - */ - deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource; - /** An active threat-model source, considered as a flow source. */ private class ActiveThreatModelSourceAsSource extends Source instanceof ActiveThreatModelSource { } @@ -69,17 +64,11 @@ module LdapInjection { */ class ConstCompareAsDnSanitizerGuard extends DnSanitizer, ConstCompareBarrier { } - /** DEPRECATED: Use ConstCompareAsDnSanitizerGuard instead. */ - deprecated class StringConstCompareAsSanitizerGuard = ConstCompareAsDnSanitizerGuard; - /** * A comparison with a constant, considered as a sanitizer-guard. */ class ConstCompareAsFilterSanitizerGuard extends FilterSanitizer, ConstCompareBarrier { } - /** DEPRECATED: Use ConstCompareAsFilterSanitizerGuard instead. */ - deprecated class StringConstCompareAsFilterSanitizerGuard = ConstCompareAsFilterSanitizerGuard; - /** * A call to replace line breaks functions as a sanitizer. */ diff --git a/python/ql/lib/semmle/python/security/dataflow/LogInjectionCustomizations.qll b/python/ql/lib/semmle/python/security/dataflow/LogInjectionCustomizations.qll index 26a7b4723dfd..313610f40a0c 100644 --- a/python/ql/lib/semmle/python/security/dataflow/LogInjectionCustomizations.qll +++ b/python/ql/lib/semmle/python/security/dataflow/LogInjectionCustomizations.qll @@ -32,11 +32,6 @@ module LogInjection { */ abstract class Sanitizer extends DataFlow::Node { } - /** - * DEPRECATED: Use `ActiveThreatModelSource` from Concepts instead! - */ - deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource; - /** An active threat-model source, considered as a flow source. */ private class ActiveThreatModelSourceAsSource extends Source instanceof ActiveThreatModelSource { } @@ -85,9 +80,6 @@ module LogInjection { */ class ConstCompareAsSanitizerGuard extends Sanitizer, ConstCompareBarrier { } - /** DEPRECATED: Use ConstCompareAsSanitizerGuard instead. */ - deprecated class StringConstCompareAsSanitizerGuard = ConstCompareAsSanitizerGuard; - /** * A call to replace line breaks, considered as a sanitizer. */ diff --git a/python/ql/lib/semmle/python/security/dataflow/PamAuthorizationCustomizations.qll b/python/ql/lib/semmle/python/security/dataflow/PamAuthorizationCustomizations.qll index 0e9dfe390694..9b8200563878 100644 --- a/python/ql/lib/semmle/python/security/dataflow/PamAuthorizationCustomizations.qll +++ b/python/ql/lib/semmle/python/security/dataflow/PamAuthorizationCustomizations.qll @@ -39,11 +39,6 @@ module PamAuthorizationCustomizations { */ abstract class Sink extends DataFlow::Node { } - /** - * DEPRECATED: Use `ActiveThreatModelSource` from Concepts instead! - */ - deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource; - /** An active threat-model source, considered as a flow source. */ private class ActiveThreatModelSourceAsSource extends Source instanceof ActiveThreatModelSource { } diff --git a/python/ql/lib/semmle/python/security/dataflow/PathInjectionCustomizations.qll b/python/ql/lib/semmle/python/security/dataflow/PathInjectionCustomizations.qll index ab43cbd861b6..f4818a52b26a 100644 --- a/python/ql/lib/semmle/python/security/dataflow/PathInjectionCustomizations.qll +++ b/python/ql/lib/semmle/python/security/dataflow/PathInjectionCustomizations.qll @@ -42,11 +42,6 @@ module PathInjection { */ abstract class Sanitizer extends DataFlow::Node { } - /** - * DEPRECATED: Use `ActiveThreatModelSource` from Concepts instead! - */ - deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource; - /** An active threat-model source, considered as a flow source. */ private class ActiveThreatModelSourceAsSource extends Source instanceof ActiveThreatModelSource { } @@ -95,9 +90,6 @@ module PathInjection { */ class ConstCompareAsSanitizerGuard extends Sanitizer, ConstCompareBarrier { } - /** DEPRECATED: Use ConstCompareAsSanitizerGuard instead. */ - deprecated class StringConstCompareAsSanitizerGuard = ConstCompareAsSanitizerGuard; - /** * A sanitizer defined via models-as-data with kind "path-injection". */ diff --git a/python/ql/lib/semmle/python/security/dataflow/PolynomialReDoSCustomizations.qll b/python/ql/lib/semmle/python/security/dataflow/PolynomialReDoSCustomizations.qll index 18c50aca6ce9..bde3f0005f44 100644 --- a/python/ql/lib/semmle/python/security/dataflow/PolynomialReDoSCustomizations.qll +++ b/python/ql/lib/semmle/python/security/dataflow/PolynomialReDoSCustomizations.qll @@ -51,11 +51,6 @@ module PolynomialReDoS { */ abstract class Sanitizer extends DataFlow::Node { } - /** - * DEPRECATED: Use `ActiveThreatModelSource` from Concepts instead! - */ - deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource; - /** An active threat-model source, considered as a flow source. */ private class ActiveThreatModelSourceAsSource extends Source instanceof ActiveThreatModelSource { } @@ -82,7 +77,4 @@ module PolynomialReDoS { * A comparison with a constant, considered as a sanitizer-guard. */ class ConstCompareAsSanitizerGuard extends Sanitizer, ConstCompareBarrier { } - - /** DEPRECATED: Use ConstCompareAsSanitizerGuard instead. */ - deprecated class StringConstCompareAsSanitizerGuard = ConstCompareAsSanitizerGuard; } diff --git a/python/ql/lib/semmle/python/security/dataflow/ReflectedXSSCustomizations.qll b/python/ql/lib/semmle/python/security/dataflow/ReflectedXSSCustomizations.qll index ced98aa4d5aa..e8e863030d33 100644 --- a/python/ql/lib/semmle/python/security/dataflow/ReflectedXSSCustomizations.qll +++ b/python/ql/lib/semmle/python/security/dataflow/ReflectedXSSCustomizations.qll @@ -32,11 +32,6 @@ module ReflectedXss { */ abstract class Sanitizer extends DataFlow::Node { } - /** - * DEPRECATED: Use `ActiveThreatModelSource` from Concepts instead! - */ - deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource; - /** An active threat-model source, considered as a flow source. */ private class ActiveThreatModelSourceAsSource extends Source instanceof ActiveThreatModelSource { } @@ -81,9 +76,6 @@ module ReflectedXss { */ class ConstCompareAsSanitizerGuard extends Sanitizer, ConstCompareBarrier { } - /** DEPRECATED: Use ConstCompareAsSanitizerGuard instead. */ - deprecated class StringConstCompareAsSanitizerGuard = ConstCompareAsSanitizerGuard; - /** * A sanitizer defined via models-as-data with kind "html-injection" or "js-injection". */ diff --git a/python/ql/lib/semmle/python/security/dataflow/RegexInjectionCustomizations.qll b/python/ql/lib/semmle/python/security/dataflow/RegexInjectionCustomizations.qll index 32c9430a8656..791479a97213 100644 --- a/python/ql/lib/semmle/python/security/dataflow/RegexInjectionCustomizations.qll +++ b/python/ql/lib/semmle/python/security/dataflow/RegexInjectionCustomizations.qll @@ -39,11 +39,6 @@ module RegexInjection { */ abstract class Sanitizer extends DataFlow::Node { } - /** - * DEPRECATED: Use `ActiveThreatModelSource` from Concepts instead! - */ - deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource; - /** An active threat-model source, considered as a flow source. */ private class ActiveThreatModelSourceAsSource extends Source instanceof ActiveThreatModelSource { } diff --git a/python/ql/lib/semmle/python/security/dataflow/ServerSideRequestForgeryCustomizations.qll b/python/ql/lib/semmle/python/security/dataflow/ServerSideRequestForgeryCustomizations.qll index 506f7fb6ecd3..8c106aeae548 100644 --- a/python/ql/lib/semmle/python/security/dataflow/ServerSideRequestForgeryCustomizations.qll +++ b/python/ql/lib/semmle/python/security/dataflow/ServerSideRequestForgeryCustomizations.qll @@ -45,11 +45,6 @@ module ServerSideRequestForgery { */ abstract class FullUrlControlSanitizer extends DataFlow::Node { } - /** - * DEPRECATED: Use `ActiveThreatModelSource` from Concepts instead! - */ - deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource; - /** An active threat-model source, considered as a flow source. */ private class ActiveThreatModelSourceAsSource extends Source instanceof ActiveThreatModelSource { } @@ -81,9 +76,6 @@ module ServerSideRequestForgery { */ class ConstCompareAsSanitizerGuard extends Sanitizer, ConstCompareBarrier { } - /** DEPRECATED: Use ConstCompareAsSanitizerGuard instead. */ - deprecated class StringConstCompareAsSanitizerGuard = ConstCompareAsSanitizerGuard; - /** * A string construction (concat, format, f-string) where the left side is not * user-controlled. diff --git a/python/ql/lib/semmle/python/security/dataflow/SqlInjectionCustomizations.qll b/python/ql/lib/semmle/python/security/dataflow/SqlInjectionCustomizations.qll index 071cbf512ffe..2d12e3ff6a44 100644 --- a/python/ql/lib/semmle/python/security/dataflow/SqlInjectionCustomizations.qll +++ b/python/ql/lib/semmle/python/security/dataflow/SqlInjectionCustomizations.qll @@ -31,11 +31,6 @@ module SqlInjection { */ abstract class Sanitizer extends DataFlow::Node { } - /** - * DEPRECATED: Use `ActiveThreatModelSource` from Concepts instead! - */ - deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource; - /** An active threat-model source, considered as a flow source. */ private class ActiveThreatModelSourceAsSource extends Source instanceof ActiveThreatModelSource { } @@ -59,9 +54,6 @@ module SqlInjection { */ class ConstCompareAsSanitizerGuard extends Sanitizer, ConstCompareBarrier { } - /** DEPRECATED: Use ConstCompareAsSanitizerGuard instead. */ - deprecated class StringConstCompareAsSanitizerGuard = ConstCompareAsSanitizerGuard; - private import semmle.python.frameworks.data.ModelsAsData /** A sink for sql-injection from model data. */ diff --git a/python/ql/lib/semmle/python/security/dataflow/UnsafeDeserializationCustomizations.qll b/python/ql/lib/semmle/python/security/dataflow/UnsafeDeserializationCustomizations.qll index 74586e768768..7f7a51c72d0d 100644 --- a/python/ql/lib/semmle/python/security/dataflow/UnsafeDeserializationCustomizations.qll +++ b/python/ql/lib/semmle/python/security/dataflow/UnsafeDeserializationCustomizations.qll @@ -32,11 +32,6 @@ module UnsafeDeserialization { */ abstract class Sanitizer extends DataFlow::Node { } - /** - * DEPRECATED: Use `ActiveThreatModelSource` from Concepts instead! - */ - deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource; - /** An active threat-model source, considered as a flow source. */ private class ActiveThreatModelSourceAsSource extends Source instanceof ActiveThreatModelSource { } @@ -62,9 +57,6 @@ module UnsafeDeserialization { */ class ConstCompareAsSanitizerGuard extends Sanitizer, ConstCompareBarrier { } - /** DEPRECATED: Use ConstCompareAsSanitizerGuard instead. */ - deprecated class StringConstCompareAsSanitizerGuard = ConstCompareAsSanitizerGuard; - /** * A sanitizer defined via models-as-data with kind "unsafe-deserialization". */ diff --git a/python/ql/lib/semmle/python/security/dataflow/UrlRedirectCustomizations.qll b/python/ql/lib/semmle/python/security/dataflow/UrlRedirectCustomizations.qll index 471af9756d23..dd92395ac46a 100644 --- a/python/ql/lib/semmle/python/security/dataflow/UrlRedirectCustomizations.qll +++ b/python/ql/lib/semmle/python/security/dataflow/UrlRedirectCustomizations.qll @@ -77,11 +77,6 @@ module UrlRedirect { ); } - /** - * DEPRECATED: Use `ActiveThreatModelSource` from Concepts instead! - */ - deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource; - /** An active threat-model source, considered as a flow source. */ private class ActiveThreatModelSourceAsSource extends Source instanceof ActiveThreatModelSource { } @@ -157,9 +152,6 @@ module UrlRedirect { } } - /** DEPRECATED: Use ConstCompareAsSanitizerGuard instead. */ - deprecated class StringConstCompareAsSanitizerGuard = ConstCompareAsSanitizerGuard; - /** * A sanitizer which sanitizes all flow states, defined via models-as-data * with kind "url-redirection". diff --git a/python/ql/lib/semmle/python/security/dataflow/XpathInjectionCustomizations.qll b/python/ql/lib/semmle/python/security/dataflow/XpathInjectionCustomizations.qll index 992ed49dca98..aa4e1f81b81f 100644 --- a/python/ql/lib/semmle/python/security/dataflow/XpathInjectionCustomizations.qll +++ b/python/ql/lib/semmle/python/security/dataflow/XpathInjectionCustomizations.qll @@ -29,11 +29,6 @@ module XpathInjection { */ abstract class Sanitizer extends DataFlow::Node { } - /** - * DEPRECATED: Use `ActiveThreatModelSource` from Concepts instead! - */ - deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource; - /** An active threat-model source, considered as a flow source. */ private class ActiveThreatModelSourceAsSource extends Source instanceof ActiveThreatModelSource { } diff --git a/python/ql/src/Resources/FileOpen.qll b/python/ql/src/Resources/FileOpen.qll deleted file mode 100644 index 1daecb6d0334..000000000000 --- a/python/ql/src/Resources/FileOpen.qll +++ /dev/null @@ -1,163 +0,0 @@ -/** - * DEPRECATED: Use FileNotAlwaysClosedQuery instead. - * Contains predicates concerning when and where files are opened and closed. - */ -deprecated module; - -import python -import semmle.python.pointsto.Filters - -/** Holds if `open` is a call that returns a newly opened file */ -predicate call_to_open(ControlFlowNode open) { - exists(FunctionValue f | - function_opens_file(f) and - f.getACall() = open - ) and - /* If in `with` statement, then it will be automatically closed. So just treat as not opened */ - not exists(With w | w.getContextExpr() = open.getNode()) -} - -/** Holds if `n` refers to a file opened at `open` */ -predicate expr_is_open(ControlFlowNode n, ControlFlowNode open) { - call_to_open(open) and open = n - or - exists(EssaVariable v | - n instanceof NameNode and - var_is_open(v, open) - | - n = v.getAUse() - or - wraps_file(n, v) - ) -} - -/** Holds if `call` wraps the object referred to by `v` and returns it */ -private predicate wraps_file(CallNode call, EssaVariable v) { - exists(ClassValue cls | - call = cls.getACall() and - call.getAnArg() = v.getAUse() - ) -} - -/** Holds if `var` refers to a file opened at `open` */ -predicate var_is_open(EssaVariable v, ControlFlowNode open) { - def_is_open(v.getDefinition(), open) and - /* If use in context expression in `with` statement, then it will be automatically closed. */ - not exists(With w | w.getContextExpr() = v.getAUse().getNode()) -} - -/** Holds if `test` will pass through an open file in variable `v` for the `sense` successor */ -predicate passes_open_files(Variable v, ControlFlowNode test, boolean sense) { - // `if fd.closed:` - exists(AttrNode closed | - closed = test and - closed.getObject("closed") = v.getAUse() - ) and - sense = false - or - // `if fd ==/is ...:` most commonly `if fd is None:` - equality_test(test, v.getAUse(), sense.booleanNot(), _) - or - // `if fd:` - test = v.getAUse() and sense = true - or - exists(UnaryExprNode n | - n = test and - n.getNode().getOp() instanceof Not - | - passes_open_files(v, n.getOperand(), sense.booleanNot()) - ) -} - -// Helper for `def_is_open` to give better join order -private predicate passes_open_files(PyEdgeRefinement refinement) { - passes_open_files(refinement.getSourceVariable(), refinement.getPredecessor().getLastNode(), - refinement.getSense()) -} - -/** Holds if `def` refers to a file opened at `open` */ -predicate def_is_open(EssaDefinition def, ControlFlowNode open) { - expr_is_open(def.(AssignmentDefinition).getValue(), open) - or - exists(PyEdgeRefinement refinement | refinement = def | - var_is_open(refinement.getInput(), open) and - passes_open_files(refinement) - ) - or - exists(EssaNodeRefinement refinement | refinement = def | - not closes_file(def) and - not wraps_file(refinement.getDefiningNode(), refinement.getInput()) and - var_is_open(refinement.getInput(), open) - ) - or - var_is_open(def.(PhiFunction).getAnInput(), open) -} - -/** Holds if `call` closes a file */ -predicate closes_file(EssaNodeRefinement call) { - closes_arg(call.(ArgumentRefinement).getDefiningNode(), call.getSourceVariable()) or - close_method_call(call.(MethodCallsiteRefinement).getCall(), - call.getSourceVariable().(Variable).getAUse()) -} - -/** Holds if `call` closes its argument, which is an open file referred to by `v` */ -predicate closes_arg(CallNode call, Variable v) { - call.getAnArg() = v.getAUse() and - ( - exists(FunctionValue close | call = close.getACall() and function_closes_file(close)) - or - call.getFunction().(NameNode).getId() = "close" - ) -} - -/** Holds if `call` closes its 'self' argument, which is an open file referred to by `v` */ -predicate close_method_call(CallNode call, ControlFlowNode self) { - call.getFunction().(AttrNode).getObject() = self and - exists(FunctionValue close | call = close.getACall() and function_closes_file(close)) - or - call.getFunction().(AttrNode).getObject("close") = self -} - -/** Holds if `close` is a function that appears to close files that are passed to it as an argument. */ -predicate function_closes_file(FunctionValue close) { - close = Value::named("os.close") - or - function_should_close_parameter(close.getScope()) -} - -/** INTERNAL - Helper predicate for `function_closes_file` */ -predicate function_should_close_parameter(Function func) { - exists(EssaDefinition def | - closes_file(def) and - def.getSourceVariable().(Variable).getScope() = func - ) -} - -/** Holds if the function `f` opens a file, either directly or indirectly. */ -predicate function_opens_file(FunctionValue f) { - f = Value::named("open") - or - exists(EssaVariable v, Return ret | ret.getScope() = f.getScope() | - v.getNode() = ret.getValue().getAUse() and - var_is_open(v, _) - ) - or - exists(Return ret, FunctionValue callee | ret.getScope() = f.getScope() | - callee.getNode() = ret.getValue().getACall() and - function_opens_file(callee) - ) -} - -/** Holds if the variable `v` refers to a file opened at `open` which is subsequently returned from a function. */ -predicate file_is_returned(EssaVariable v, ControlFlowNode open) { - exists(NameNode n, Return ret | - var_is_open(v, open) and - v.getAUse() = n - | - ret.getValue() = n.getNode() - or - ret.getValue().(Tuple).getAnElt() = n.getNode() - or - ret.getValue().(List).getAnElt() = n.getNode() - ) -} diff --git a/python/ql/src/Security/CWE-327/FluentApiModel.qll b/python/ql/src/Security/CWE-327/FluentApiModel.qll index 0f8dae7b3167..9311cdbcb3a1 100644 --- a/python/ql/src/Security/CWE-327/FluentApiModel.qll +++ b/python/ql/src/Security/CWE-327/FluentApiModel.qll @@ -116,11 +116,6 @@ module InsecureContextConfig implements DataFlow::StateConfigSig { } } -/** - * DEPRECATED: Renamed to `InsecureContextConfig`. - */ -deprecated module InsecureContextConfiguration = InsecureContextConfig; - private module InsecureContextFlow = DataFlow::GlobalWithState; /** diff --git a/python/ql/src/change-notes/2026-11-18-outdated-deprecations.md b/python/ql/src/change-notes/2026-11-18-outdated-deprecations.md new file mode 100644 index 000000000000..c95870d35ba7 --- /dev/null +++ b/python/ql/src/change-notes/2026-11-18-outdated-deprecations.md @@ -0,0 +1,5 @@ +--- +category: breaking +--- +* Removed the deprecated `Resources.FileOpen` module. Use `FileNotAlwaysClosedQuery` instead. +* Removed the deprecated `InsecureContextConfiguration` alias. Use `InsecureContextConfig` instead.