/** * @name XML external entity expansion * @description Parsing user input as an XML document with external * entity expansion is vulnerable to XXE attacks. * @kind path-problem * @problem.severity error * @security-severity 9.1 * @precision high * @id js/xxe * @tags security * external/cwe/cwe-611 * external/cwe/cwe-827 */ import javascript import semmle.javascript.security.dataflow.XxeQuery import DataFlow::PathGraph from Configuration cfg, DataFlow::PathNode source, DataFlow::PathNode sink where cfg.hasFlowPath(source, sink) select sink.getNode(), source, sink, "A $@ is parsed as XML without guarding against external entity expansion.", source.getNode(), "user-provided value"