-
-
Notifications
You must be signed in to change notification settings - Fork 401
Synapse windows command injection false positive #2998
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
Comments
@fuomag9 Hi and thanks for reporting this. We will look into it shortly. The problem here is with |
What about to use htmlEntityDecode transformation function in rule |
Could you give it a try and see whether all the tests still pass? Also: Does it really solve the issue? Other than that there are of course also 3 PL2 findings. |
Tested on my local copy: It resolved the issue. Will send a PR. |
Don't rush into this. It's a major change to an important rule. We need to discuss this with the team first. Do all the tests still pass? (Or do you want to do for easy execution of the tests?) |
I meant i will send a PR so tests can run. |
Looks good: #3151 |
It's very cool to see CRS used in front of a Matrix service! It looks like the This looks like the same situation as working with WordPress, DokuWiki, etc., and handling arbitrary HTML input ('Save wiki page', 'Publish blog post', etc.) and all of HTML's combinations of tags, angle brackets, semi-colons… |
What is a Matrix service? (asking for a friend) |
@dune73 It's a FOSS service/protocol for secure, decentralised, real-time messaging. It bridges together IRC, Slack, WhatsApp etc. into a single logical channel/service. I heard it was gaining lots of traction in European government circles, who like the idea of self-hosted, end-to-end encrypted communications with auditable code… Also the Matrix developers consistently deliver really cool talks at FOSDEM. |
Thank you |
I think that using |
My thinking goes in a similar direction: Conceptually, there is a loss of information in the decoding step: Multi-Byte strings are reduced to a single-byte string. @theseion : The decoding is only for the WAF, is not it? The application would receive the original payload. |
Exactly. So if the entity is transformed into an |
This! |
Hi @fuomag9, The We discussed this issue at our project meeting this evening (starting from 20:41:38 UTC, if you want to read the chat history). In line with previous issues we've handled regarding passing HTML through CRS, we agreed that this false positive isn't something we can safely or realistically resolve by changing the offending CRS rule itself. To resolve this false positive you'll need to tune it away in your CRS/ModSecurity configuration. We have some great documentation on this subject. Let us know if you'd like any help with this or getting started. Is the service that you had the issue with the Matrix bridge for libera.chat? Are you maintaining a ModSecurity+CRS WAF in front of it? We would potentially be interested in helping to create a CRS plugin for Matrix, if there is interest in the wider community for this. Such a plugin would resolve false positives like the one you ran into here before they occur. Do you know of anyone else running CRS in front of a Matrix bridge? |
Hi, I do not run modsecurity anymore as I’ve switched to caddy and coraza is still not production ready for what I’ve seen. The issue I had was with my own server as I do self host a Matrix server and I was running modsecurity+crs in front of it. As far as I know the matrix.org team runs cloudflare in front of it, which if I remember correctly uses their version of CRS rules and allows custom rules as well. Maybe they could help you better than me? |
Sorry for the delayed reply @fuomag9. Thank you for the information in your previous message.
I see, so your self-hosted Matrix instance was syncing messages with the libera.chat instance. That makes sense 🙂 Thanks for clarifying. Did you manage to resolve the false positive? Let us know if you need any help with that. |
Unfortunately I am not able to debug this issue anymore :( |
I understand. Thanks for letting us know. Feel free to re-open this issue if you need to take it further in the future. Closing now. |
Description
Audit Logs / Triggered Rule Numbers
932115
Your Environment
Confirmation
[x] I have removed any personal data (email addresses, IP addresses,
passwords, domain names) from any logs posted.
The text was updated successfully, but these errors were encountered: