Skip to content
This repository was archived by the owner on May 14, 2020. It is now read-only.

Add missing urldecodeuni operations#590

Closed
csjperon wants to merge 1 commit into
SpiderLabs:v3.0.0-rc2from
csjperon:v3.0.0-rc2
Closed

Add missing urldecodeuni operations#590
csjperon wants to merge 1 commit into
SpiderLabs:v3.0.0-rc2from
csjperon:v3.0.0-rc2

Conversation

@csjperon
Copy link
Copy Markdown
Contributor

@csjperon csjperon commented Sep 22, 2016

Missed from previous PR #578

@csjperon
Copy link
Copy Markdown
Contributor Author

Note that I intentionally skipped 920230 See the tail end of the discussion on #578

@dune73
Copy link
Copy Markdown
Contributor

dune73 commented Sep 23, 2016

Good catch. Thanks for the pull.

Tested this an it looks good to me.

One thing for future PRs: Would you mind giving your branches a different name than the one in the official repo? (-> diffing v3.0.0-rc2 against v3.0.0-rc2 is tricky).

Copy link
Copy Markdown
Contributor

@dune73 dune73 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested. Looks good.

(trying out new github functionality with these formal reviews)

@csjperon
Copy link
Copy Markdown
Contributor Author

Ah yeah.. apologies about the branch name

@dune73
Copy link
Copy Markdown
Contributor

dune73 commented Sep 23, 2016

No worries. If I was not such a git n00b, I would know how to do it despite the branch name. ;)

@dune73
Copy link
Copy Markdown
Contributor

dune73 commented Sep 24, 2016

Any opposition to merging?

@lifeforms
Copy link
Copy Markdown
Contributor

lifeforms commented Sep 24, 2016

@dune73 Unfortunately I haven't been able to follow this issue closely due to other commitments. It's quite a big change, but as I said earlier to you, I'm not fully up to date on the guidelines around urlDecodeUni so I may not be qualified to comment.

If I'm correct, does it mean that on Apache, the payloads will now be url-decoded twice before scanning (once by Apache, once by CRS), but on other web servers it will happen once (only by CRS)? Could this difference not allow for evasions, since we will scan a twice-decoded version but the Apache backend will be passed it url-decoded once? This sounds scary to me. It could allow %xx / %uxxxx sequences to disappear into another character. But I haven't been able to think of evasions from the top of my head, since % is not often a magic character in other contexts that I know of.

My preference would be to ensure that ModSecurity passes us the same input on all server types, so if the input to the rules differ, shouldn't it be a ModSecurity fix rather than a CRS workaround that might impact the biggest platform (Apache)?

But, I'm jumping into this very late, as I haven't been able to follow the discussion leading up to the PR, for which I apologize.

@csanders-git
Copy link
Copy Markdown
Contributor

This is true -- I believe anything in Phase 2 will automatically be decoded already and as a result it will be decoded twice potentially allowing bypasses, that is a nasty problem. @lifeforms

@csanders-git
Copy link
Copy Markdown
Contributor

csanders-git commented Oct 11, 2016

I'm not sure we can make this change as a result of what @lifeforms bought up. We should either note in our documentation that ARGS is expected to be urldecoded or say that this change only has support in something like modsec v3 (@zimmerle take note this decision affects you)

In any event for the time being we should probably put this off for discussion for a bit and push it to 3.1 if consensus can't be reached as it doesn't affect the core platforms.

@dune73
Copy link
Copy Markdown
Contributor

dune73 commented Oct 11, 2016

This is a painful topic.

Would this mean we need to roll back PR #578 and clean out all the cases where this has been applied "traditionally"?

@csanders-git csanders-git added this to the CRS v3.1.0 RC1 milestone Oct 12, 2016
@dune73
Copy link
Copy Markdown
Contributor

dune73 commented Oct 31, 2016

We have not really come to a conclusion here, I think. With the 1st decode-patch merged and the 2nd one not merged, we are in a fairly unclean situation.

Will we really leave this as is?

I mean we can actually postpone a fix to 3.0.1 if we want to.

@csanders-git
Copy link
Copy Markdown
Contributor

I think we have to do something like that. We need to experiment with trying to get access to ARGS in non-decoded form.

fgsch added a commit to fgsch/coreruleset-old that referenced this pull request Oct 31, 2019
Stop decoding things twice. See SpiderLabs#590 for details.
@fgsch fgsch mentioned this pull request Oct 31, 2019
fgsch added a commit to fgsch/coreruleset-old that referenced this pull request Dec 3, 2019
Stop decoding things twice. See SpiderLabs#590 for details.
fgsch added a commit to fgsch/coreruleset-old that referenced this pull request Dec 4, 2019
Stop decoding things twice. See SpiderLabs#590 for details.
fgsch added a commit to fgsch/coreruleset-old that referenced this pull request Dec 12, 2019
Stop decoding things twice. See SpiderLabs#590 for details.
fgsch added a commit to fgsch/coreruleset-old that referenced this pull request Jan 6, 2020
Stop decoding things twice. See SpiderLabs#590 for details.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants