@@ -453,99 +453,102 @@ module RegexExecution {
453453 }
454454}
455455
456- /**
457- * A data-flow node that constructs an XPath expression.
458- *
459- * Often, it is worthy of an alert if an XPath expression is constructed such that
460- * executing it would be a security risk.
461- *
462- * If it is important that the XPath expression is indeed executed, then use `XPathExecution`.
463- *
464- * Extend this class to refine existing API models. If you want to model new APIs,
465- * extend `XPathConstruction::Range` instead.
466- */
467- class XPathConstruction extends DataFlow:: Node {
468- XPathConstruction:: Range range ;
469-
470- XPathConstruction ( ) { this = range }
471-
472- /** Gets the argument that specifies the XPath expressions to be constructed. */
473- DataFlow:: Node getXPath ( ) { result = range .getXPath ( ) }
474-
475- /**
476- * Gets the name of this XPath expression construction, typically the name of an executing method.
477- * This is used for nice alert messages and should include the module if possible.
478- */
479- string getName ( ) { result = range .getName ( ) }
480- }
481-
482- /** Provides a class for modeling new XPath construction APIs. */
483- module XPathConstruction {
456+ /** Provides classes for modeling XML-related APIs. */
457+ module XML {
484458 /**
485459 * A data-flow node that constructs an XPath expression.
486460 *
487461 * Often, it is worthy of an alert if an XPath expression is constructed such that
488462 * executing it would be a security risk.
489463 *
490- * Extend this class to model new APIs. If you want to refine existing API models,
491- * extend `XPathConstruction` instead.
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.
492468 */
493- abstract class Range extends DataFlow:: Node {
469+ class XPathConstruction extends DataFlow:: Node {
470+ XPathConstruction:: Range range ;
471+
472+ XPathConstruction ( ) { this = range }
473+
494474 /** Gets the argument that specifies the XPath expressions to be constructed. */
495- abstract DataFlow:: Node getXPath ( ) ;
475+ DataFlow:: Node getXPath ( ) { result = range . getXPath ( ) }
496476
497477 /**
498478 * Gets the name of this XPath expression construction, typically the name of an executing method.
499479 * This is used for nice alert messages and should include the module if possible.
500480 */
501- abstract string getName ( ) ;
481+ string getName ( ) { result = range . getName ( ) }
502482 }
503- }
504-
505- /**
506- * A data-flow node that executes a xpath expression.
507- *
508- * If the context of interest is such that merely constructing an XPath expression
509- * would be valuabe to report, then consider using `XPathConstruction`.
510- *
511- * Extend this class to refine existing API models. If you want to model new APIs,
512- * extend `XPathExecution::Range` instead.
513- */
514- class XPathExecution extends DataFlow:: Node {
515- XPathExecution:: Range range ;
516-
517- XPathExecution ( ) { this = range }
518483
519- /** Gets the data flow node for the XPath expression being executed by this node. */
520- DataFlow:: Node getXPath ( ) { result = range .getXPath ( ) }
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 ( ) ;
521498
522- /**
523- * Gets the name of this XPath expression execution, typically the name of an executing method.
524- * This is used for nice alert messages and should include the module if possible.
525- */
526- string getName ( ) { result = range .getName ( ) }
527- }
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+ }
528506
529- /** Provides classes for modeling new regular-expression execution APIs. */
530- module XPathExecution {
531507 /**
532- * A data-flow node that executes a XPath expression.
508+ * A data-flow node that executes a xpath expression.
533509 *
534510 * If the context of interest is such that merely constructing an XPath expression
535511 * would be valuabe to report, then consider using `XPathConstruction`.
536512 *
537- * Extend this class to model new APIs . If you want to refine existing API models ,
538- * extend `XPathExecution` instead.
513+ * Extend this class to refine existing API models . If you want to model new APIs ,
514+ * extend `XPathExecution::Range ` instead.
539515 */
540- abstract class Range extends DataFlow:: Node {
516+ class XPathExecution extends DataFlow:: Node {
517+ XPathExecution:: Range range ;
518+
519+ XPathExecution ( ) { this = range }
520+
541521 /** Gets the data flow node for the XPath expression being executed by this node. */
542- abstract DataFlow:: Node getXPath ( ) ;
522+ DataFlow:: Node getXPath ( ) { result = range . getXPath ( ) }
543523
544524 /**
545- * Gets the name of this xpath expression execution, typically the name of an executing method.
525+ * Gets the name of this XPath expression execution, typically the name of an executing method.
546526 * This is used for nice alert messages and should include the module if possible.
547527 */
548- abstract string getName ( ) ;
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+ }
549552 }
550553}
551554
0 commit comments