mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-10-07 14:56:19 +03:00
Add capture action to @detectXSS operator
This commit is contained in:
committed by
Felipe Zimmerle
parent
185ec6f72e
commit
9b90d86f75
@@ -2158,12 +2158,14 @@ static int msre_op_detectSQLi_execute(modsec_rec *msr, msre_rule *rule, msre_var
|
|||||||
*/
|
*/
|
||||||
static int msre_op_detectXSS_execute(modsec_rec *msr, msre_rule *rule, msre_var *var,
|
static int msre_op_detectXSS_execute(modsec_rec *msr, msre_rule *rule, msre_var *var,
|
||||||
char **error_msg) {
|
char **error_msg) {
|
||||||
|
int capture;
|
||||||
int is_xss;
|
int is_xss;
|
||||||
|
|
||||||
is_xss = libinjection_xss(var->value, var->value_len);
|
is_xss = libinjection_xss(var->value, var->value_len);
|
||||||
|
capture = apr_table_get(rule->actionset->actions, "capture") ? 1 : 0;
|
||||||
|
|
||||||
if (is_xss) {
|
if (is_xss) {
|
||||||
|
set_match_to_tx(msr, capture, var->value, 0);
|
||||||
*error_msg = apr_psprintf(msr->mp, "detected XSS using libinjection.");
|
*error_msg = apr_psprintf(msr->mp, "detected XSS using libinjection.");
|
||||||
|
|
||||||
if (msr->txcfg->debuglog_level >= 9) {
|
if (msr->txcfg->debuglog_level >= 9) {
|
||||||
|
Reference in New Issue
Block a user