vetkit.swift.webview.file-access-from-file-urls
A WKWebView preference enables allowFileAccessFromFileURLs through KVC. JavaScript in a file:// page can read other local files.
Last updated:
Suite: Security
swift
A WKWebView preference enables allowFileAccessFromFileURLs through KVC. JavaScript in a file:// page can read other local files.
Category: SECURITY · Engine rule severity: WARNING
How to fix it
Remove the private KVC flag and restrict local loads with loadFileURL(_:allowingReadAccessTo:).
Rule pattern example
The engine’s matching pattern, not a confirmed exploit. Metavariables and ellipses describe matching syntax.
$PREFS.setValue(true, forKey: "allowFileAccessFromFileURLs")References
Source: packages/engine/rules/sast/swift.yml.
Generated from shipped rule definitions at build time. Matching is a review signal, not proof of exploitability. “generic” denotes text matching, not complete language or framework coverage. Runtime configuration and available tools affect whether a rule runs.