Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SecResponseBodyAccess and ctl:requestBodyAccess directives #1886

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
v3.0.3 - YYYY-MMM-DD (to be released)
-------------------------------------

- Fix SecResponseBodyAccess and ctl:requestBodyAccess directives
[Issue #1531 - @victorhora, @defanator]
- Adds support for ctl:requestBodyProcessor=URLENCODED
[Issue #1797 - @victorhora]
- Add LUA compatibility for CentOS and try to use LuaJIT first if available
Expand Down
9 changes: 2 additions & 7 deletions src/transaction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -766,14 +766,11 @@ int Transaction::processRequestBody() {
m_variableReqbodyProcessorError.set("0", m_variableOffset);
}

#if 1
if (m_rules->m_secRequestBodyAccess != RulesProperties::TrueConfigBoolean) {
if (m_rules->m_secRequestBodyAccess == RulesProperties::FalseConfigBoolean) {
if (m_requestBodyAccess != RulesProperties::TrueConfigBoolean) {
#ifndef NO_LOGS
debug(4, "Request body processing is disabled");
#endif

this->m_rules->evaluate(modsecurity::RequestBodyPhase, this);
return true;
} else {
#ifndef NO_LOGS
Expand All @@ -786,14 +783,12 @@ int Transaction::processRequestBody() {
if (m_requestBodyAccess == RulesProperties::FalseConfigBoolean) {
#ifndef NO_LOGS
debug(4, "Request body processing is enabled, but " \
"disable to this transaction due to ctl:requestBodyAccess " \
"disabled to this transaction due to ctl:requestBodyAccess " \
"action");
#endif
this->m_rules->evaluate(modsecurity::RequestBodyPhase, this);
return true;
}
}
#endif

/**
* FIXME: This variable should be calculated on demand, it is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
]
},
"expected":{
"debug_log":"Request body processing is enabled, but disable to this transaction due to ctl:requestBodyAccess action"
"debug_log":"Request body processing is enabled, but disabled to this transaction due to ctl:requestBodyAccess action"
},
"rules":[
"SecRuleEngine On",
Expand Down