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

Conflict with Cloudflare Web Application Firewall #4805

Closed
1 of 3 tasks
swissspidy opened this issue Oct 5, 2020 · 4 comments · Fixed by #4859
Closed
1 of 3 tasks

Conflict with Cloudflare Web Application Firewall #4805

swissspidy opened this issue Oct 5, 2020 · 4 comments · Fixed by #4859
Labels
P1 High priority, must do soon Type: Bug Something isn't working Type: Support Questions & Feedback from support escalation.

Comments

@swissspidy
Copy link
Collaborator

swissspidy commented Oct 5, 2020

If you are coming from the support forums or encounter the following issue, please read carefully.

This is a tracking ticket for the work on ensuring Web Stories for WordPress does not cause issues with the Cloudflare Web Aplication Firewall (WAF) or similar solutions.

Rules that so far have been identified as possibly causing conflicts:

  • Cloudflare Specials > 100173 XSS, HTML Injection - Script Tag
  • OWASP mod_security ruleset 981176

A similar conflict exists with Sucuri's WAF.

Who's affected?

The Cloudflare WAF is available to Pro, Business, and Enterprise plans.

How do I know I am affected?

You are likely affected when using Cloudflare's WAF offering and you are unable to save or publish stories using Web Stories for WordPress.

Workaround

Cloudflare:

Add a custom Firewall rule to disable the WAF for any Web Stories-related REST API requests, like so:

Screen Shot 2020-10-02 at 12 34 56 PM

Sucuri:

Add wp-json/web-stories to the allowlist in the "Whitelist URL Paths" section.

What is being done to fix this?

We are still investigating this issue and will update this thread with any new findings.

How can I follow progress on this issue?

Subscribe to this issue using the "Subscribe" button in the sidebar:

Screenshot 2020-09-25 at 11 06 42


User reports so far

@swissspidy swissspidy added Type: Bug Something isn't working P1 High priority, must do soon Epic Type: Support Questions & Feedback from support escalation. labels Oct 5, 2020
@swissspidy
Copy link
Collaborator Author

My first assumption was that the WAF kicks in because we save the full AMP HTML markup via the REST API, but preliminary testing by @LuckynaSan & @ernee showed that this doesn't happen in all cases. For example, some templates can be used and previewed/published just fine. But creating a blank new story fails every time with a 403 error.

I haven't done any in-depth testing with various configurations yet myself, but I found some valuable old threads on this when Gutenberg faced the same issue:

Then, the OWASP ModSecurity Core Rule Set (CRS) added some exceptions for Gutenberg:

@swissspidy
Copy link
Collaborator Author

swissspidy commented Oct 28, 2020

In version 1.1.0 of the plugin there will be an experimental workaround for this. To enable:

  1. Add define( 'WEBSTORIES_DEV_MODE', true ); to your wp-config.php file
    (somewhere before the /* That's all, stop editing! Happy publishing. */) line)
  2. In your WordPress admin, go to Stories -> Experiments
  3. Toggle the WAF Compatibility checkbox and save the changes.
  4. Create a new story!

@swissspidy
Copy link
Collaborator Author

Closing in favor of #5059

@mateusnds
Copy link

mateusnds commented Dec 12, 2020

If you are coming from the support forums or encounter the following issue, please read carefully.

Thank You

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 High priority, must do soon Type: Bug Something isn't working Type: Support Questions & Feedback from support escalation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants