Skip to content

Commit 7175879

Browse files
committed
Allow MaD sanitizers for java/xml/xpath-injection
1 parent 3dc07ce commit 7175879

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

java/ql/lib/semmle/code/java/security/XPath.qll

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,10 @@ private class DefaultXPathInjectionSink extends XPathInjectionSink {
2727
)
2828
}
2929
}
30+
31+
/** A sanitizer for XPath injection. */
32+
abstract class XPathInjectionSanitizer extends DataFlow::Node { }
33+
34+
private class ExternalXPathInjectionSanitizer extends XPathInjectionSanitizer {
35+
ExternalXPathInjectionSanitizer() { barrierNode(this, "xpath-injection") }
36+
}

java/ql/lib/semmle/code/java/security/XPathInjectionQuery.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ module XPathInjectionConfig implements DataFlow::ConfigSig {
1313

1414
predicate isSink(DataFlow::Node sink) { sink instanceof XPathInjectionSink }
1515

16+
predicate isBarrier(DataFlow::Node node) { node instanceof XPathInjectionSanitizer }
17+
1618
predicate observeDiffInformedIncrementalMode() { any() }
1719
}
1820

0 commit comments

Comments
 (0)