Zum Inhalt springen

Open Redirect (ARCH9122)

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

Key swift.security.open-redirect · Severity warning · Category security · CWE CWE-601

Flags req.redirect(to:) / UIApplication.open with a target that comes from request or user data.

return req.redirect(to: req.query["next"] ?? "/")
let next = req.query[String.self, at: "next"]
guard allowed.contains(next) else { return req.redirect(to: "/") }

Allow-list redirect targets, or accept only relative paths.