Skip to content

Commit 9b90d86

Browse files
victorhoraFelipe Zimmerle
authored and
Felipe Zimmerle
committed
Add capture action to @detectXSS operator
1 parent 185ec6f commit 9b90d86

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

apache2/re_operators.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2158,12 +2158,14 @@ static int msre_op_detectSQLi_execute(modsec_rec *msr, msre_rule *rule, msre_var
21582158
*/
21592159
static int msre_op_detectXSS_execute(modsec_rec *msr, msre_rule *rule, msre_var *var,
21602160
char **error_msg) {
2161-
2161+
int capture;
21622162
int is_xss;
21632163

21642164
is_xss = libinjection_xss(var->value, var->value_len);
2165+
capture = apr_table_get(rule->actionset->actions, "capture") ? 1 : 0;
21652166

21662167
if (is_xss) {
2168+
set_match_to_tx(msr, capture, var->value, 0);
21672169
*error_msg = apr_psprintf(msr->mp, "detected XSS using libinjection.");
21682170

21692171
if (msr->txcfg->debuglog_level >= 9) {

0 commit comments

Comments
 (0)