From 652a9ca7f23b4c0b4d9203575ae21add36c8e0a8 Mon Sep 17 00:00:00 2001 From: Joe Farebrother Date: Wed, 11 Dec 2024 11:54:01 +0000 Subject: [PATCH] Add missing qldoc and revert accidentilly commited threat model change --- python/ql/lib/semmle/python/frameworks/Lxml.qll | 12 ++++++++++++ .../ext/supported-threat-models.model.yml | 3 +-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/python/ql/lib/semmle/python/frameworks/Lxml.qll b/python/ql/lib/semmle/python/frameworks/Lxml.qll index e12c9e696d0d2..872230fddb554 100644 --- a/python/ql/lib/semmle/python/frameworks/Lxml.qll +++ b/python/ql/lib/semmle/python/frameworks/Lxml.qll @@ -322,7 +322,17 @@ module Lxml { /** Gets a reference to the `Element` class. */ API::Node classRef() { result = etreeRef().getMember(["Element", "_Element"]) } + /** + * A source of instances of `lxml.etree.Element` instances, extend this class to model new instances. + * + * This can include instantiations of the class, return values from function + * calls, or a special parameter that will be set when functions are called by an external + * library. + * + * Use the predicate `Element::instance()` to get references to instances of `lxml.etree.ElementTree` instances. + */ abstract class InstanceSource instanceof API::Node { + /** Gets a textual representation of this element. */ string toString() { result = super.toString() } } @@ -410,6 +420,7 @@ module Lxml { /** Provides models for instances of the `lxml.etree.ElementTree` class. */ module ElementTree { + /** Gets a reference to the `ElementTree` class. */ API::Node classRef() { result = etreeRef().getMember(["ElementTree", "_ElementTree"]) } /** @@ -422,6 +433,7 @@ module Lxml { * Use the predicate `ElementTree::instance()` to get references to instances of `lxml.etree.ElementTree` instances. */ abstract class InstanceSource instanceof API::Node { + /** Gets a textual representation of this element. */ string toString() { result = super.toString() } } diff --git a/shared/threat-models/ext/supported-threat-models.model.yml b/shared/threat-models/ext/supported-threat-models.model.yml index dd20a30d7c97f..e85a6e937845d 100644 --- a/shared/threat-models/ext/supported-threat-models.model.yml +++ b/shared/threat-models/ext/supported-threat-models.model.yml @@ -3,5 +3,4 @@ extensions: pack: codeql/threat-models extensible: threatModelConfiguration data: - - ["default", true, -2147483648] # The "default" threat model is included by default - - ["all", true, 1] \ No newline at end of file + - ["default", true, -2147483648] # The "default" threat model is included by default \ No newline at end of file