-
-
Notifications
You must be signed in to change notification settings - Fork 606
[Security] Due to the default caching of POST requests personal information can be leaked #1434
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
[Security] Due to the default caching of POST requests personal information can be leaked #1434
Conversation
Wow I'm surprised this has never come up, thank you. I agree this should be the default.
I'm not too worried about this since DDoS protection isn't really the purpose of the cache (though I guess a nice bonus if it helps). Plus they could already target non-cached pages. This cache is designed to be conservative and safe by default, which should include these new condition. |
How about a allow-list approach?
Otherwise, we need to handle DELETE as well. |
@tangrufus I do think that's a better refactor. We can look at that separately after this? |
I think switching the I could also tweak the commit to something like so:
Untested |
The grouping + comment is nice 👍 |
As per: https://www.rfc-editor.org/rfc/rfc7231#section-4.1 "The method token is case-sensitive because it might be used as a gateway to object-based systems with case-sensitive method names."
Thanks @craigpearson 🚀 |
Adding OPTIONS to that might be a good idea too. You really only want to be caching GET & HEAD. So that means everything below should skip the cache: CONNECT |
…mation can be leaked (roots#1434) As per: https://www.rfc-editor.org/rfc/rfc7231#section-4.1
…mation can be leaked (roots#1434) As per: https://www.rfc-editor.org/rfc/rfc7231#section-4.1
We've just had a GDPR issue with WooCommerce and Trellis, based on the trellis docs here: https://docs.roots.io/trellis/master/fastcgi-caching/#example-cache-configurations
Specifically for WooCommerce you assume that by adding the
skip_cache_uri
parameters for WooCommerce is enough, however, POST data can still be stored on another URL, and recalled on an uncached page.As a result although our checkout page was uncached, the way that WooCommerce outputs data on the checkout page, is to check for POST data containing customer information, if that data exists it outputs it. This is only visible as an issue if you are making requests within the cache window specified.
That POST data can be set on other WooCommerce pages not included in the
skip_cache_uri
, such as checkout completion.This could also be a problem for other plugins taking personal data via POST such as Gravity Forms etc. Although Trellis can't account for a users specific configuration, should someone not set a URI where POST data is set in the
skip_cache_uri
then that data is cached by default and potentially leaked to the worldThe caveat to this is, that setting a default of not caching any POST data could result as a bypass to any DDoS protection via POST requests, however this seems like a safer default given the data POST can contain. To get around DDoS concerns we could potentially add an option to enable caching of POST data, but with a warning / disclaimer