From 49ef6939d41ebdb5e6875ca33354c9f7442f6638 Mon Sep 17 00:00:00 2001 From: Kristen Newbury Date: Tue, 19 Aug 2025 14:49:31 -0400 Subject: [PATCH 1/4] Add extra Customizations files --- cpp/ql/lib/Customizations.qll | 12 ++++++++++++ cpp/ql/lib/cpp.qll | 1 + rust/ql/lib/Customizations.qll | 12 ++++++++++++ rust/ql/lib/rust.qll | 1 + swift/ql/lib/Customizations.qll | 12 ++++++++++++ swift/ql/lib/swift.qll | 1 + 6 files changed, 39 insertions(+) create mode 100644 cpp/ql/lib/Customizations.qll create mode 100644 rust/ql/lib/Customizations.qll create mode 100644 swift/ql/lib/Customizations.qll diff --git a/cpp/ql/lib/Customizations.qll b/cpp/ql/lib/Customizations.qll new file mode 100644 index 000000000000..76a4355b69c4 --- /dev/null +++ b/cpp/ql/lib/Customizations.qll @@ -0,0 +1,12 @@ +/** + * Contains customizations to the standard library. + * + * This module is imported by `cpp.qll`, so any customizations defined here automatically + * apply to all queries. + * + * Typical examples of customizations include adding new subclasses of abstract classes such as + * the `RemoteFlowSource` class + * to model frameworks that are not covered by the standard library. + */ + +import cpp diff --git a/cpp/ql/lib/cpp.qll b/cpp/ql/lib/cpp.qll index ccd32c368e4b..c8afac1c7ae9 100644 --- a/cpp/ql/lib/cpp.qll +++ b/cpp/ql/lib/cpp.qll @@ -13,6 +13,7 @@ * https://github.com/cplusplus/draft/raw/master/papers/n4140.pdf */ +import Customizations import semmle.code.cpp.File import semmle.code.cpp.Linkage import semmle.code.cpp.Location diff --git a/rust/ql/lib/Customizations.qll b/rust/ql/lib/Customizations.qll new file mode 100644 index 000000000000..4f67cb910497 --- /dev/null +++ b/rust/ql/lib/Customizations.qll @@ -0,0 +1,12 @@ +/** + * Contains customizations to the standard library. + * + * This module is imported by `rust.qll`, so any customizations defined here automatically + * apply to all queries. + * + * Typical examples of customizations include adding new subclasses of abstract classes such as + * the `RemoteFlowSource` class + * to model frameworks that are not covered by the standard library. + */ + +import rust diff --git a/rust/ql/lib/rust.qll b/rust/ql/lib/rust.qll index e7d02adea32b..b46e96868f63 100644 --- a/rust/ql/lib/rust.qll +++ b/rust/ql/lib/rust.qll @@ -1,5 +1,6 @@ /** Top-level import for the Rust language pack */ +import Customizations import codeql.rust.elements import codeql.Locations import codeql.files.FileSystem diff --git a/swift/ql/lib/Customizations.qll b/swift/ql/lib/Customizations.qll new file mode 100644 index 000000000000..71684ba1f755 --- /dev/null +++ b/swift/ql/lib/Customizations.qll @@ -0,0 +1,12 @@ +/** + * Contains customizations to the standard library. + * + * This module is imported by `swift.qll`, so any customizations defined here automatically + * apply to all queries. + * + * Typical examples of customizations include adding new subclasses of abstract classes such as + * the `RemoteFlowSource` class + * to model frameworks that are not covered by the standard library. + */ + +import swift diff --git a/swift/ql/lib/swift.qll b/swift/ql/lib/swift.qll index 901d9e895e02..54f2abf90925 100644 --- a/swift/ql/lib/swift.qll +++ b/swift/ql/lib/swift.qll @@ -1,5 +1,6 @@ /** Top-level import for the Swift language pack */ +import Customizations import codeql.swift.elements import codeql.swift.elements.expr.ArithmeticOperation import codeql.swift.elements.expr.Assignment From d630e32ce9f714674a99a3cbb881157f4ac37216 Mon Sep 17 00:00:00 2001 From: Kristen Newbury Date: Tue, 19 Aug 2025 15:27:29 -0400 Subject: [PATCH 2/4] Format Customizations.qll --- cpp/ql/lib/Customizations.qll | 2 +- rust/ql/lib/Customizations.qll | 2 +- swift/ql/lib/Customizations.qll | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cpp/ql/lib/Customizations.qll b/cpp/ql/lib/Customizations.qll index 76a4355b69c4..88e83346ef1d 100644 --- a/cpp/ql/lib/Customizations.qll +++ b/cpp/ql/lib/Customizations.qll @@ -8,5 +8,5 @@ * the `RemoteFlowSource` class * to model frameworks that are not covered by the standard library. */ - + import cpp diff --git a/rust/ql/lib/Customizations.qll b/rust/ql/lib/Customizations.qll index 4f67cb910497..822792df6c79 100644 --- a/rust/ql/lib/Customizations.qll +++ b/rust/ql/lib/Customizations.qll @@ -8,5 +8,5 @@ * the `RemoteFlowSource` class * to model frameworks that are not covered by the standard library. */ - + import rust diff --git a/swift/ql/lib/Customizations.qll b/swift/ql/lib/Customizations.qll index 71684ba1f755..001628f21104 100644 --- a/swift/ql/lib/Customizations.qll +++ b/swift/ql/lib/Customizations.qll @@ -8,5 +8,5 @@ * the `RemoteFlowSource` class * to model frameworks that are not covered by the standard library. */ - + import swift From c9f0e3a37744c1868781d915590d62970d9d9e03 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema <93738568+jketema@users.noreply.github.com> Date: Wed, 20 Aug 2025 08:07:10 +0200 Subject: [PATCH 3/4] Apply suggestions from code review --- cpp/ql/lib/Customizations.qll | 3 +-- rust/ql/lib/Customizations.qll | 3 +-- swift/ql/lib/Customizations.qll | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/cpp/ql/lib/Customizations.qll b/cpp/ql/lib/Customizations.qll index 88e83346ef1d..c9d899e07e01 100644 --- a/cpp/ql/lib/Customizations.qll +++ b/cpp/ql/lib/Customizations.qll @@ -5,8 +5,7 @@ * apply to all queries. * * Typical examples of customizations include adding new subclasses of abstract classes such as - * the `RemoteFlowSource` class - * to model frameworks that are not covered by the standard library. + * the `RemoteFlowSource` class to model frameworks that are not covered by the standard library. */ import cpp diff --git a/rust/ql/lib/Customizations.qll b/rust/ql/lib/Customizations.qll index 822792df6c79..8fc6bbea9116 100644 --- a/rust/ql/lib/Customizations.qll +++ b/rust/ql/lib/Customizations.qll @@ -5,8 +5,7 @@ * apply to all queries. * * Typical examples of customizations include adding new subclasses of abstract classes such as - * the `RemoteFlowSource` class - * to model frameworks that are not covered by the standard library. + * the `RemoteFlowSource` class to model frameworks that are not covered by the standard library. */ import rust diff --git a/swift/ql/lib/Customizations.qll b/swift/ql/lib/Customizations.qll index 001628f21104..bf9e66de70b8 100644 --- a/swift/ql/lib/Customizations.qll +++ b/swift/ql/lib/Customizations.qll @@ -5,8 +5,7 @@ * apply to all queries. * * Typical examples of customizations include adding new subclasses of abstract classes such as - * the `RemoteFlowSource` class - * to model frameworks that are not covered by the standard library. + * the `RemoteFlowSource` class to model frameworks that are not covered by the standard library. */ import swift From 854a5b58713c7a5737748379e6c34a0a3df0e909 Mon Sep 17 00:00:00 2001 From: Kristen Newbury Date: Wed, 20 Aug 2025 13:18:17 -0400 Subject: [PATCH 4/4] Add changenotes customizations addition --- cpp/ql/src/change-notes/2025-08-20-add-customizations.md | 4 ++++ rust/ql/src/change-notes/2025-08-20-add-customizations.md | 4 ++++ swift/ql/src/change-notes/2025-08-20-add-customizations.md | 4 ++++ 3 files changed, 12 insertions(+) create mode 100644 cpp/ql/src/change-notes/2025-08-20-add-customizations.md create mode 100644 rust/ql/src/change-notes/2025-08-20-add-customizations.md create mode 100644 swift/ql/src/change-notes/2025-08-20-add-customizations.md diff --git a/cpp/ql/src/change-notes/2025-08-20-add-customizations.md b/cpp/ql/src/change-notes/2025-08-20-add-customizations.md new file mode 100644 index 000000000000..3a01298283ca --- /dev/null +++ b/cpp/ql/src/change-notes/2025-08-20-add-customizations.md @@ -0,0 +1,4 @@ +--- +category: fix +--- +* Fixed an inconsistency across languages where most have a `Customizations.qll` file for adding customizations, but not all did. \ No newline at end of file diff --git a/rust/ql/src/change-notes/2025-08-20-add-customizations.md b/rust/ql/src/change-notes/2025-08-20-add-customizations.md new file mode 100644 index 000000000000..3a01298283ca --- /dev/null +++ b/rust/ql/src/change-notes/2025-08-20-add-customizations.md @@ -0,0 +1,4 @@ +--- +category: fix +--- +* Fixed an inconsistency across languages where most have a `Customizations.qll` file for adding customizations, but not all did. \ No newline at end of file diff --git a/swift/ql/src/change-notes/2025-08-20-add-customizations.md b/swift/ql/src/change-notes/2025-08-20-add-customizations.md new file mode 100644 index 000000000000..3a01298283ca --- /dev/null +++ b/swift/ql/src/change-notes/2025-08-20-add-customizations.md @@ -0,0 +1,4 @@ +--- +category: fix +--- +* Fixed an inconsistency across languages where most have a `Customizations.qll` file for adding customizations, but not all did. \ No newline at end of file