@@ -334,6 +334,7 @@ module CodeExecution {
334334
335335/**
336336 * A data-flow node that constructs an SQL statement.
337+ *
337338 * Often, it is worthy of an alert if an SQL statement is constructed such that
338339 * executing it would be a security risk.
339340 *
@@ -355,11 +356,14 @@ class SqlConstruction extends DataFlow::Node {
355356module SqlConstruction {
356357 /**
357358 * A data-flow node that constructs an SQL statement.
359+ *
358360 * Often, it is worthy of an alert if an SQL statement is constructed such that
359361 * executing it would be a security risk.
360362 *
363+ * If it is important that the SQL statement is indeed executed, then use `SQLExecution`.
364+ *
361365 * Extend this class to model new APIs. If you want to refine existing API models,
362- * extend `SqlExecution ` instead.
366+ * extend `SqlConstruction ` instead.
363367 */
364368 abstract class Range extends DataFlow:: Node {
365369 /** Gets the argument that specifies the SQL statements to be constructed. */
@@ -449,6 +453,105 @@ module RegexExecution {
449453 }
450454}
451455
456+ /** Provides classes for modeling XML-related APIs. */
457+ module XML {
458+ /**
459+ * A data-flow node that constructs an XPath expression.
460+ *
461+ * Often, it is worthy of an alert if an XPath expression is constructed such that
462+ * executing it would be a security risk.
463+ *
464+ * If it is important that the XPath expression is indeed executed, then use `XPathExecution`.
465+ *
466+ * Extend this class to refine existing API models. If you want to model new APIs,
467+ * extend `XPathConstruction::Range` instead.
468+ */
469+ class XPathConstruction extends DataFlow:: Node {
470+ XPathConstruction:: Range range ;
471+
472+ XPathConstruction ( ) { this = range }
473+
474+ /** Gets the argument that specifies the XPath expressions to be constructed. */
475+ DataFlow:: Node getXPath ( ) { result = range .getXPath ( ) }
476+
477+ /**
478+ * Gets the name of this XPath expression construction, typically the name of an executing method.
479+ * This is used for nice alert messages and should include the module if possible.
480+ */
481+ string getName ( ) { result = range .getName ( ) }
482+ }
483+
484+ /** Provides a class for modeling new XPath construction APIs. */
485+ module XPathConstruction {
486+ /**
487+ * A data-flow node that constructs an XPath expression.
488+ *
489+ * Often, it is worthy of an alert if an XPath expression is constructed such that
490+ * executing it would be a security risk.
491+ *
492+ * Extend this class to model new APIs. If you want to refine existing API models,
493+ * extend `XPathConstruction` instead.
494+ */
495+ abstract class Range extends DataFlow:: Node {
496+ /** Gets the argument that specifies the XPath expressions to be constructed. */
497+ abstract DataFlow:: Node getXPath ( ) ;
498+
499+ /**
500+ * Gets the name of this XPath expression construction, typically the name of an executing method.
501+ * This is used for nice alert messages and should include the module if possible.
502+ */
503+ abstract string getName ( ) ;
504+ }
505+ }
506+
507+ /**
508+ * A data-flow node that executes a xpath expression.
509+ *
510+ * If the context of interest is such that merely constructing an XPath expression
511+ * would be valuabe to report, then consider using `XPathConstruction`.
512+ *
513+ * Extend this class to refine existing API models. If you want to model new APIs,
514+ * extend `XPathExecution::Range` instead.
515+ */
516+ class XPathExecution extends DataFlow:: Node {
517+ XPathExecution:: Range range ;
518+
519+ XPathExecution ( ) { this = range }
520+
521+ /** Gets the data flow node for the XPath expression being executed by this node. */
522+ DataFlow:: Node getXPath ( ) { result = range .getXPath ( ) }
523+
524+ /**
525+ * Gets the name of this XPath expression execution, typically the name of an executing method.
526+ * This is used for nice alert messages and should include the module if possible.
527+ */
528+ string getName ( ) { result = range .getName ( ) }
529+ }
530+
531+ /** Provides classes for modeling new regular-expression execution APIs. */
532+ module XPathExecution {
533+ /**
534+ * A data-flow node that executes a XPath expression.
535+ *
536+ * If the context of interest is such that merely constructing an XPath expression
537+ * would be valuabe to report, then consider using `XPathConstruction`.
538+ *
539+ * Extend this class to model new APIs. If you want to refine existing API models,
540+ * extend `XPathExecution` instead.
541+ */
542+ abstract class Range extends DataFlow:: Node {
543+ /** Gets the data flow node for the XPath expression being executed by this node. */
544+ abstract DataFlow:: Node getXPath ( ) ;
545+
546+ /**
547+ * Gets the name of this xpath expression execution, typically the name of an executing method.
548+ * This is used for nice alert messages and should include the module if possible.
549+ */
550+ abstract string getName ( ) ;
551+ }
552+ }
553+ }
554+
452555/** Provides classes for modeling LDAP-related APIs. */
453556module LDAP {
454557 /**
0 commit comments