This was originally reported as a private security issue, but has been approved for handling in the public queue by the Drupal Security Team.
Background information
- security.drupal.org private issue: https://security.drupal.org/node/184318
(included for reference. Please do not report access denied as an error.)
Problem/Motivation
The locale.check_translation route empties the locale project storage without a confirmation.
The impact is very limited but this feels like something that should be protected against CSRF.
Steps to reproduce
- As a user that can insert img tag on the site, insert this HTML:
<img src="http://example.com/admin/reports/translations/check"> - If a user with the "translate interface" permission displays the page, the locale project storage is emptied.
Proposed resolution
Add the _csrf_token requirement to the route.
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3575821
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
prudloff commentedComment #4
prudloff commentedComment #5
smustgrave commentedLeft comments on the MR.
Comment #6
prudloff commentedComments have been addressed.
Comment #7
berdirI think this looks OK now.
Comment #11
longwaveCommitted and pushed 474d7c361e8 to main and 4b42b8c533a to 11.x and b3ddfca1463 to 11.4.x. Thanks!
As a security fix this is also eligible for backport to 10.6.x but it doesn't cherry-pick cleanly; leaving open for backport if someone can open a new MR against 10.6.x.
Comment #13
smustgrave commentedSince it's been 1 month don't want this one to get forgotten
Moving to RTBC as the backport was pretty straight forward just issue around
Comment #14
smustgrave commentedOops forgot something one second.
Comment #15
smustgrave commentedOh no I didn't core/modules/locale/tests/src/Functional/LocaleFileHashTest.php isn't in 10.6.x
Comment #17
longwaveLet's just close this out.
Committed and pushed 1f5f2c4ee46 to 10.6.x. Thanks!