From 4903b50515cdc03d14a1eb3cbc6d37dab2fc7b43 Mon Sep 17 00:00:00 2001 From: SquidSec Bot Date: Tue, 28 Jul 2026 16:09:02 -0400 Subject: [PATCH] sample(swift): intentional vulnerabilities for SquidGate demo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Demo only — hardcoded secret + injection / dangerous API patterns. See examples/README.md --- examples/swift/Demo.swift | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 examples/swift/Demo.swift diff --git a/examples/swift/Demo.swift b/examples/swift/Demo.swift new file mode 100644 index 0000000..c8f982c --- /dev/null +++ b/examples/swift/Demo.swift @@ -0,0 +1,15 @@ +// SquidGate sample — Swift (intentional vulnerabilities for demo) +let apiKey = "swift-demo-secret-key-not-real" + +func findUser(id: String) -> String { + // SQL injection + return "SELECT * FROM users WHERE id = '\(id)'" +} + +func runShell(_ input: String) { + // command injection + let task = Process() + task.launchPath = "/bin/sh" + task.arguments = ["-c", "echo \(input)"] + task.launch() +}