1 /*
2  * ModSecurity, http://www.modsecurity.org/
3  * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/)
4  *
5  * You may not use this file except in compliance with
6  * the License.  You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * If any of the files related to licensing are missing or if you have any
11  * other questions related to licensing please contact Trustwave Holdings, Inc.
12  * directly using the email address security@modsecurity.org.
13  *
14  */
15 
16 #ifndef SRC_OPERATORS_DETECT_XSS_H_
17 #define SRC_OPERATORS_DETECT_XSS_H_
18 
19 #include <string>
20 
21 #include "src/operators/operator.h"
22 
23 namespace modsecurity {
24 namespace operators {
25 
26 class DetectXSS : public Operator {
27  public:
28     /** @ingroup ModSecurity_Operator */
DetectXSS()29     DetectXSS()
30         : Operator("DetectXSS") {
31             m_match_message.assign("detected XSS using libinjection.");
32         }
33 
34     bool evaluate(Transaction *t, RuleWithActions *rule,
35         const std::string& input,
36         std::shared_ptr<RuleMessage> ruleMessage) override;
37 };
38 
39 }  // namespace operators
40 }  // namespace modsecurity
41 
42 
43 #endif  // SRC_OPERATORS_DETECT_XSS_H_
44