Hello Street41akaFerro/Andrea,
I understand that you're facing an issue where unwanted cookies sent by browsers are being identified as SQL injections by the WAF policy.
Here are a few ways you might mitigate this kind of issue:
- Please check your application’s cookie policies and make sure you're only allowing cookies that are essential for your application functionality.
- Implementing a Content Security Policy can help mitigate the impact by specifying which domains are permitted to send cookies. While this might not completely block cookies, it can reduce the risk of injections by restricting where cookies can be loaded from.
- You can try to rewrite or filter out unwanted cookies at the application level. This may involve examining incoming requests and removing any cookies that were not expected from the browser.
- Log the cookies sent to your application to help identify patterns or specific browsers and configurations responsible for these unwanted requests.
- Although you can't control the browser settings, you should alert your users if they are sending unwanted cookies (such as through an error message) or provide guidance on adjusting their settings if they have control over them.
- You can try Rule Exclusions in your WAF policy which can help in this scenario. By using exclusions, you can fine-tune how OWASP 3.2 rules are applied so that legitimate traffic—like certain cookies that aren't actually malicious—doesn't get blocked.
- You can configure exclusions to ignore specific cookie headers that are falsely triggering SQL Injection detections. Instead of turning off entire rulesets, you can exclude traffic from triggering specific rules, reducing false positives.
- If certain browsers or known clients are sending these unintended cookies, you might be able to allow them without compromising security.
- Also, you should be cautious when applying exclusions—make sure you’re not inadvertently exposing your application to actual threats. Have you considered logging and analyzing these requests to pinpoint which cookies are problematic? That could help refine your exclusion strategy.
I hope this clarifies things! If you have any additional questions or need further assistance, just add a comment below. so that we shall address your questions.
Please click "Accept" the answer, if any answer/reply helped, so that others in the community facing similar issues can easily find the solution. This can be beneficial to other community members.