تخطَّ إلى المحتوى

XPath Injection (ARCH9108)

هذا المحتوى غير متوفر بلغتك بعد.

Key swift.security.xpath-injection · Severity error · Category security · CWE CWE-643

Flags XPath expressions built by interpolation (nodes(forXPath: "...\(name)...")).

try doc.nodes(forXPath: "//user[@name='\(name)']")
escape the value or walk the tree and compare attributes

Never interpolate untrusted data into an XPath expression.