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

Content filter profile - arg with "/" isn't decoded #1129

Open
olgasobolevsky opened this issue Dec 14, 2022 · 2 comments
Open

Content filter profile - arg with "/" isn't decoded #1129

olgasobolevsky opened this issue Dec 14, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@olgasobolevsky
Copy link
Collaborator

Describe the bug
when I send arg <script> encoded with base 64 the arg is decoded and blocked. But when I send <script>alert()</script> encoded with base64 the arg isn’t decoded and isn’t blocked.
We don’t do decoding for args with “/”.

To Reproduce
Steps to reproduce the behavior:

  1. Set Content filter profile to default with base64 decoding.
  2. Send request: curl -vv "[url]/t -H "host:default.site" -d "xc=PHNjcmlwdD5hbGVydCgpPC9zY3JpcHQ+"

Actual result: the request isn't blocked, we don't see encoded arg in logs.
el 200

Expected behavior

  1. The request is blocked by content filter
  2. Events Log: we see encoded arg
    For example: if I send arg <script>, we see in Event log:
    el 473
@olgasobolevsky olgasobolevsky added the bug Something isn't working label Dec 14, 2022
@bartavelle
Copy link
Collaborator

Notice how the + has disappeared from the argument value. It has actually been replaced by a space, because the argument is assumed to be url-encoded (base on the content type), so + becomes , and the string is not longer a valid base64 string.

@bartavelle
Copy link
Collaborator

If you want to test this, you must use -d "xc=PHNjcmlwdD5hbGVydCgpPC9zY3JpcHQ%2B"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants