XML external entity (ARCH3105)
Esta página aún no está disponible en tu idioma.
Key typescript.security.xxe · Severity error · Category security · CWE CWE-611
Configuring an XML parser to resolve external entities lets attackers perform XXE injection for file reads, SSRF, or denial of service.
Incorrect
Section titled “Incorrect”import { parseXml } from "libxmljs2";
// noent: true resolves external entitiesconst doc = parseXml(req.body, { noent: true, dtdload: true });Correct
Section titled “Correct”import { parseXml } from "libxmljs2";
// External entity and DTD loading disabled (default)const doc = parseXml(req.body, { noent: false, nonet: true });Disable DTD and external entity resolution; keep entity-expansion options turned off.