View Issue Details

IDProjectCategoryView StatusLast Update
0005890Composrcorepublic2024-09-06 01:58
ReporterPatrick SchmalstigAssigned ToPatrick Schmalstig 
SeverityFeature-request 
Status closedResolutionwon't fix 
Product Version 
Fixed in Version 
Summary0005890: Consider additionally validating CSRF via cookie
DescriptionAs an added layer of security, consider also setting the CSRF token as an HttpOnly / Secure cookie, and upon server-side validation, validate both the POST parameters and the cookies to ensure the CSRF token has been passed in by both methods and is correct.

Make sure this will work for AJAX requests especially. And check to see if there are any downsides to this approach, such as compatibility (e.g. what if cookies are rejected?).
Additional InformationImplementing this will make forging the token exceptionally harder by attackers.
TagsRoadmap: v11, Type: Security
Time estimation (hours)
Sponsorship open

Relationships

related to 0005887 resolvedPatrick Schmalstig Session cookies should always be HttpOnly / Secure where applicable 

Activities

Patrick Schmalstig

2024-08-14 19:31

administrator   ~0009193

Last edited: 2024-08-14 19:35

View 3 revisions

Will need to make special considerations for http_requests.

If we REALLY wanted to go hardcore, we could also make it so the cookie is a different token from what is put on the forms. Both are stored with the user session. And both need to be validated accordingly and matched correctly server-side to pass. That way, if the token is stolen from one method, it still won't work. Maybe this could be a config option, and enabled only with the "high/extreme" security profiles by the Setup Wizard.

Patrick Schmalstig

2024-09-06 01:38

administrator   ~0009300

This might not work for AJAX requests because they need a way to get a CSRF token. They do this through a secondary AJAX request getting a token, but this method will prevent being able to set an HttpOnly CSRF cookie for additional validation.

Patrick Schmalstig

2024-09-06 01:58

administrator   ~0009301

Actually OWASP does not recommend transmitting the token as a cookie for the sync token CSRF method in stateful apps (which Composr is stateful).

Closing.

Issue History

Date Modified Username Field Change
2024-08-14 19:29 Patrick Schmalstig New Issue
2024-08-14 19:29 Patrick Schmalstig Status non-assigned => assigned
2024-08-14 19:29 Patrick Schmalstig Assigned To => Patrick Schmalstig
2024-08-14 19:29 Patrick Schmalstig Tag Attached: Roadmap: v11
2024-08-14 19:29 Patrick Schmalstig Tag Attached: Type: Security
2024-08-14 19:29 Patrick Schmalstig Relationship added related to 0005887
2024-08-14 19:31 Patrick Schmalstig Note Added: 0009193
2024-08-14 19:32 Patrick Schmalstig Additional Information Updated View Revisions
2024-08-14 19:34 Patrick Schmalstig Note Edited: 0009193 View Revisions
2024-08-14 19:35 Patrick Schmalstig Note Edited: 0009193 View Revisions
2024-09-06 01:38 Patrick Schmalstig Note Added: 0009300
2024-09-06 01:58 Patrick Schmalstig Status assigned => closed
2024-09-06 01:58 Patrick Schmalstig Resolution open => won't fix
2024-09-06 01:58 Patrick Schmalstig Note Added: 0009301