Opened 15 years ago
Last modified 11 days ago
#16612 new enhancement
WordPress should return nocache headers for requests with comment cookies
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | |
| Component: | Comments | Keywords: | has-patch 2nd-opinion reporter-feedback |
| Focuses: | Cc: |
Description (last modified by )
Most themes, when displaying the comment form, change the HTML to pre-fill username, email address, and website when comment cookies are received in the HTTP request. Since the response does not have explicit nocache headers, per RFC2616 (http://www.ietf.org/rfc/rfc2616.txt) intermediate caches can use heuristics to determine the cache TTL for the response. Since there is 0 freshness data in the response, it is not really possible to perform good heuristics, but in practice, caches will assign a default TTL to this type of response. The result is that private information input by user A when submitting a comment can be returned to user B when making a request for the same URL.
To protect ourselves against this, we should call nocache_headers() when comment cookies are sent and the comment form is being displayed. Alternatively, we can send nocache headers for all requests with comment cookies regardless of the comment form being displayed or not (probably easier and maybe safer).
http://humboldtherald.wordpress.com/2011/01/27/gremlins/ is a story likely caused by an aggressive cache and the lack of nocache headers.
Attachments (3)
Change History (17)
#6
@
10 years ago
- Keywords needs-testing added; needs-refresh removed
Added refreshed version of the patch as 16612.diff.
This ticket was mentioned in Slack in #core by helen. View the logs.
9 years ago
#11
@
9 years ago
Was Vary: Cookie ever discussed? If going with the existing patch, it needs a different function name.
@rachelbaker: Still want to do this 4.7-early?
#12
@
9 years ago
- Keywords 2nd-opinion added; 4.7-early removed
- Milestone changed from Awaiting Review to Future Release
@helen I am not aware of any discussion or plans to implement Vary: Cookie headers. I defer to @wonderboymusic or @markjaquith for a more informed response.
#14
@
11 days ago
- Keywords reporter-feedback added; needs-testing removed
Tested against trunk (7.0-alpha-61215-src).
Attempted to apply the latest patch (16612.3.diff) using grunt patch:16612, but it does not apply cleanly.
Conflicts:
- src/wp-includes/class-wp.php (.rej created)
Because the patch no longer applies, testing is not currently possible.
As this patch is ~9 years old, requesting reporter/component maintainer feedback on whether this is still need.
The fix :)