Originally reported to the Drupal security team by @hchonov on 13 July 2018 (#167135). Assuming it affects the latest version, this issue's version is set to D10.1
Problem/Motivation
In \Drupal\content_translation\Controller\ContentTranslationController::overview() the access checks for the entity "update" and "delete" operations are made on the current entity object from the route match, which will be loaded in the current content language or in a fallback language. There we iterate through the translation languages of the entity and build the links for the entity operations for each language - for the "update" and "delete" operations. Unfortunately the access check is being made for each language using the entity object from the route match and not the entity translation object for the language for which the links are being build. This is a bug preventing proper entity access control per entity translation.
Steps to reproduce
Proposed resolution
When checking for update and delete operations access use the entity in the corresponding entity translation.
Remaining tasks
Copy the test from the patch in #3257030: Inconsistent access check of the update/delete access on content translations results in 403 to this issue
Create MR
Review
Commit
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 3371291-4-11.x.patch | 5.61 KB | hchonov |
| #4 | 3371291-4-10.5.x.patch | 5.7 KB | hchonov |
Comments
Comment #2
dokumori commentedcomment by @berdir
Comment #3
gregglesSeems like this is a duplicate.
Comment #4
hchonovActually, the issues have different focus where the current one is a bug, while the other one is a task for refactoring. The current one only needs changing the access checks with the entity translation.
Comment #5
quietone commentedHi, Issues for Drupal core should be targeted to the 'main' branch, our primary development branch. Changes are made on the main branch first, and are then back ported as needed according to the Core change policies. The version the problem was discovered on should be stated in the issue summary Problem/Motivation section. Thanks.
Drupal 10 is in maintenance mode with a limited set of allow changes.
Comment #6
smustgrave commentedHave not reviewed but fixes will need to be in MRs vs patches please
Also will need test coverage showing the issue.
Comment #7
quietone commentedWork done by longwave using an LLM that identified this as a duplicate of #3257030: Inconsistent access check of the update/delete access on content translations results in 403 and suggested closing this one. After reading both issues I am closing the earlier one so that this newer patch is used. However, there is a test in the other issue that needs to be ported here.
I've updated the remaining tasks about the test..