Closed (fixed)
Project:
Legal
Version:
3.0.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
29 Apr 2022 at 16:48 UTC
Updated:
2 Jun 2024 at 21:19 UTC
Jump to comment: Most recent
The LegalLogin form does not perform any checks on the values retrieved from cookies. If the cookie values get tampered with this can cause a fatal PHP error.
Setup the module and log in with a user who's required to accept legal terms. When viewing the terms, go to the inspector and find the cookie values. Edit the Drupal.visitor.legal_id value to be a non-existing user ID integer. Submit the form and notice the PHP error.
Add some more checks to exit gracefully if the cookie value is not a valid ID.
n/a
n/a
n/a
n/a
| Comment | File | Size | Author |
|---|---|---|---|
| legal_form_checks.patch | 2.76 KB | alecsmrekar |
Comments
Comment #2
plachLooks good to me and works well here.
Comment #3
anybodyComment #4
anybody@alecsmrekar could you reroll this against 3.0.x as MR perhaps?
Comment #5
robert castelo commentedWhy do we need to "exit gracefully" if someone tampers with the cookie value?
Comment #6
robert castelo commentedAdded in https://www.drupal.org/project/legal/issues/3376194.