İçeriğe geç

XPath enjeksiyonu (ARCH9108)

Anahtar swift.security.xpath-injection · Önem error · Kategori security · CWE CWE-643

Interpolasyonla kurulan XPath ifadelerini (nodes(forXPath: "...\(name)...")) işaretler.

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

Güvenilmeyen veriyi asla XPath ifadesine gömmeyin.