mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 11:44:32 +03:00
gsb now saves the base url in tx.1 when match a full url
This commit is contained in:
@@ -1429,11 +1429,18 @@ static int msre_op_gsbLookup_execute(modsec_rec *msr, msre_rule *rule, msre_var
|
||||
ret = verify_gsb(gsb, rule, match, match_length);
|
||||
|
||||
if(ret > 0) {
|
||||
set_match_to_tx(msr, capture, match);
|
||||
set_match_to_tx(msr, capture, match, 0);
|
||||
if (! *error_msg) {
|
||||
*error_msg = apr_psprintf(msr->mp, "Gsb lookup for \"%s\" succeeded.",
|
||||
log_escape_nq(msr->mp, match));
|
||||
}
|
||||
|
||||
str = apr_pstrdup(rule->ruleset->mp,match);
|
||||
|
||||
base = apr_strtok(str,"/",&savedptr);
|
||||
if(base != NULL)
|
||||
set_match_to_tx(msr, capture, base, 1);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1451,11 +1458,18 @@ static int msre_op_gsbLookup_execute(modsec_rec *msr, msre_rule *rule, msre_var
|
||||
ret = verify_gsb(gsb, rule, canon, canon_length);
|
||||
|
||||
if(ret > 0) {
|
||||
set_match_to_tx(msr, capture, match);
|
||||
set_match_to_tx(msr, capture, match, 0);
|
||||
if (! *error_msg) {
|
||||
*error_msg = apr_psprintf(msr->mp, "Gsb lookup for \"%s\" succeeded.",
|
||||
log_escape_nq(msr->mp, canon));
|
||||
}
|
||||
|
||||
str = apr_pstrdup(rule->ruleset->mp,match);
|
||||
|
||||
base = apr_strtok(str,"/",&savedptr);
|
||||
if(base != NULL)
|
||||
set_match_to_tx(msr, capture, base, 1);
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -1482,7 +1496,7 @@ static int msre_op_gsbLookup_execute(modsec_rec *msr, msre_rule *rule, msre_var
|
||||
ret = verify_gsb(gsb, rule, canon, canon_length);
|
||||
|
||||
if(ret > 0) {
|
||||
set_match_to_tx(msr, capture, canon);
|
||||
set_match_to_tx(msr, capture, canon, 0);
|
||||
if (! *error_msg) {
|
||||
*error_msg = apr_psprintf(msr->mp, "Gsb lookup for \"%s\" succeeded.",
|
||||
log_escape_nq(msr->mp, canon));
|
||||
|
Reference in New Issue
Block a user