From 0f8b0a7fdd93689ebe71adce52f464c4410c62cf Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Thu, 7 May 2026 10:04:19 +0100 Subject: [PATCH] Swift: Accept test changes (improvement). --- .../query-tests/Security/CWE-311/CleartextTransmission.expected | 2 ++ .../test/query-tests/Security/CWE-311/SensitiveExprs.expected | 1 + swift/ql/test/query-tests/Security/CWE-311/testSend.swift | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/swift/ql/test/query-tests/Security/CWE-311/CleartextTransmission.expected b/swift/ql/test/query-tests/Security/CWE-311/CleartextTransmission.expected index c772466344a..7665b72b11a 100644 --- a/swift/ql/test/query-tests/Security/CWE-311/CleartextTransmission.expected +++ b/swift/ql/test/query-tests/Security/CWE-311/CleartextTransmission.expected @@ -64,6 +64,7 @@ nodes | testSend.swift:78:27:78:30 | .CarePlanID | semmle.label | .CarePlanID | | testSend.swift:79:27:79:30 | .BankCardNo | semmle.label | .BankCardNo | | testSend.swift:80:27:80:30 | .MyCreditRating | semmle.label | .MyCreditRating | +| testSend.swift:81:27:81:30 | .OneTimeCode | semmle.label | .OneTimeCode | | testSend.swift:86:7:86:7 | self | semmle.label | self | | testSend.swift:94:27:94:30 | .password | semmle.label | .password | | testSend.swift:94:27:94:39 | .value | semmle.label | .value | @@ -118,6 +119,7 @@ subpaths | testSend.swift:78:27:78:30 | .CarePlanID | testSend.swift:78:27:78:30 | .CarePlanID | testSend.swift:78:27:78:30 | .CarePlanID | This operation transmits '.CarePlanID', which may contain unencrypted sensitive data from $@. | testSend.swift:78:27:78:30 | .CarePlanID | .CarePlanID | | testSend.swift:79:27:79:30 | .BankCardNo | testSend.swift:79:27:79:30 | .BankCardNo | testSend.swift:79:27:79:30 | .BankCardNo | This operation transmits '.BankCardNo', which may contain unencrypted sensitive data from $@. | testSend.swift:79:27:79:30 | .BankCardNo | .BankCardNo | | testSend.swift:80:27:80:30 | .MyCreditRating | testSend.swift:80:27:80:30 | .MyCreditRating | testSend.swift:80:27:80:30 | .MyCreditRating | This operation transmits '.MyCreditRating', which may contain unencrypted sensitive data from $@. | testSend.swift:80:27:80:30 | .MyCreditRating | .MyCreditRating | +| testSend.swift:81:27:81:30 | .OneTimeCode | testSend.swift:81:27:81:30 | .OneTimeCode | testSend.swift:81:27:81:30 | .OneTimeCode | This operation transmits '.OneTimeCode', which may contain unencrypted sensitive data from $@. | testSend.swift:81:27:81:30 | .OneTimeCode | .OneTimeCode | | testSend.swift:94:27:94:39 | .value | testSend.swift:94:27:94:30 | .password | testSend.swift:94:27:94:39 | .value | This operation transmits '.value', which may contain unencrypted sensitive data from $@. | testSend.swift:94:27:94:30 | .password | .password | | testURL.swift:39:18:39:50 | ... .+(_:_:) ... | testURL.swift:39:50:39:50 | passwd | testURL.swift:39:18:39:50 | ... .+(_:_:) ... | This operation transmits '... .+(_:_:) ...', which may contain unencrypted sensitive data from $@. | testURL.swift:39:50:39:50 | passwd | passwd | | testURL.swift:41:18:41:51 | ... .+(_:_:) ... | testURL.swift:41:51:41:51 | account_no | testURL.swift:41:18:41:51 | ... .+(_:_:) ... | This operation transmits '... .+(_:_:) ...', which may contain unencrypted sensitive data from $@. | testURL.swift:41:51:41:51 | account_no | account_no | diff --git a/swift/ql/test/query-tests/Security/CWE-311/SensitiveExprs.expected b/swift/ql/test/query-tests/Security/CWE-311/SensitiveExprs.expected index c4ff7f42b2e..62fc29a9a58 100644 --- a/swift/ql/test/query-tests/Security/CWE-311/SensitiveExprs.expected +++ b/swift/ql/test/query-tests/Security/CWE-311/SensitiveExprs.expected @@ -170,6 +170,7 @@ | testSend.swift:78:27:78:30 | .CarePlanID | label:CarePlanID, type:private information | | testSend.swift:79:27:79:30 | .BankCardNo | label:BankCardNo, type:private information | | testSend.swift:80:27:80:30 | .MyCreditRating | label:MyCreditRating, type:private information | +| testSend.swift:81:27:81:30 | .OneTimeCode | label:OneTimeCode, type:credential | | testSend.swift:94:27:94:30 | .password | label:password, type:password | | testURL.swift:39:50:39:50 | passwd | label:passwd, type:password | | testURL.swift:41:51:41:51 | account_no | label:account_no, type:private information | diff --git a/swift/ql/test/query-tests/Security/CWE-311/testSend.swift b/swift/ql/test/query-tests/Security/CWE-311/testSend.swift index 8acb83e51c1..bea4dfa16b6 100644 --- a/swift/ql/test/query-tests/Security/CWE-311/testSend.swift +++ b/swift/ql/test/query-tests/Security/CWE-311/testSend.swift @@ -78,7 +78,7 @@ func test2(password : String, license_key: String, ms: MyStruct, connection : NW connection.send(content: ms.CarePlanID, completion: .idempotent) // BAD connection.send(content: ms.BankCardNo, completion: .idempotent) // BAD connection.send(content: ms.MyCreditRating, completion: .idempotent) // BAD - connection.send(content: ms.OneTimeCode, completion: .idempotent) // BAD [NOT DETECTED] + connection.send(content: ms.OneTimeCode, completion: .idempotent) // BAD } struct MyOuter {