From c190fae737e6f0c8501dd41ad43fe72d5f102cf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nora=20Dimitrijevi=C4=87?= Date: Tue, 14 Oct 2025 14:55:28 +0200 Subject: [PATCH] Swift/CleartextStoragePreferencesQuery swift/ql/src/queries/Security/CWE-312/CleartextStoragePreferences.ql --- .../swift/security/CleartextStoragePreferencesQuery.qll | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/swift/ql/lib/codeql/swift/security/CleartextStoragePreferencesQuery.qll b/swift/ql/lib/codeql/swift/security/CleartextStoragePreferencesQuery.qll index c3665589482..a0d3414f249 100644 --- a/swift/ql/lib/codeql/swift/security/CleartextStoragePreferencesQuery.qll +++ b/swift/ql/lib/codeql/swift/security/CleartextStoragePreferencesQuery.qll @@ -34,12 +34,9 @@ module CleartextStoragePreferencesConfig implements DataFlow::ConfigSig { predicate observeDiffInformedIncrementalMode() { any() } Location getASelectedSinkLocation(DataFlow::Node sink) { - exists(DataFlow::Node cleanSink | result = cleanSink.getLocation() | - cleanSink = sink.(DataFlow::PostUpdateNode).getPreUpdateNode() - or - not sink instanceof DataFlow::PostUpdateNode and - cleanSink = sink - ) + result = sink.(CleartextStoragePreferencesSink).getLocation() + or + result = sink.(DataFlow::PostUpdateNode).getPreUpdateNode().getLocation() } }