Zennoxa Shield
Rules / Swift
SHIELD-SWIFT-011

Arbitrary insecure HTTP loads allowed

highSwiftCWE-319CVSS 7.4

What it detects

App Transport Security is disabled via NSAllowsArbitraryLoads or insecure HTTP exceptions.

How to fix

Remove the ATS exception and require HTTPS with valid certificates for all endpoints.

Vulnerable — Shield flags thisGenerateInfoPlist.swift
import Foundation

// Build script: emits the app Info.plist before packaging.
let infoPlist: [String: Any] = [
    "CFBundleName": "ShieldDemo",
    "NSAppTransportSecurity": ["NSAllowsArbitraryLoads": true]
]
Fixed — scans cleanGenerateInfoPlist.swift
import Foundation

// Build script: ATS stays at its secure default - HTTPS with valid certs only.
let infoPlist: [String: Any] = [
    "CFBundleName": "ShieldDemo",
    "CFBundleShortVersionString": "1.0.0"
]

Both snippets are verified against the shipped scanner: the vulnerable one triggers SHIELD-SWIFT-011, the fixed one does not.

SHIELD-SWIFT-011: Arbitrary insecure HTTP loads allowed — Zennoxa Shield