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

CommentFileSizeAuthor
#4 3371291-4-11.x.patch5.61 KBhchonov
#4 3371291-4-10.5.x.patch5.7 KBhchonov

Comments

dokumori created an issue. See original summary.

dokumori’s picture

comment by @berdir

Considerable parts of this fix have been part of a public issues since 2018: https://www.drupal.org/node/2155787.

However, the public patch there does more things that I think are questionable and I think are not necessary, but I'm not sure how to move forward with that public issue. Focusing on this problem there would basically put even more focus on those parts and be the same as fixing this publicly. This also has tests that would be nice to have.

AFAIK, worst case scenario is that it allows someone to change or add translations of an entity in a language that they are not meant to. That's definitely a bug, but a security issue? I personally don't think so. We could just make it public?

greggles’s picture

Status: Active » Closed (duplicate)
Related issues: +#2155787: Introduce more flexible access control for content translation operations

Seems like this is a duplicate.

hchonov’s picture

Status: Closed (duplicate) » Needs review
StatusFileSize
new5.7 KB
new5.61 KB

Actually, 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.

quietone’s picture

Version: 10.1.x-dev » main

Hi, 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.

smustgrave’s picture

Status: Needs review » Needs work

Have not reviewed but fixes will need to be in MRs vs patches please

Also will need test coverage showing the issue.

quietone’s picture

Title: Content Translation: "update" and "delete" entity operation access checks are not made on the correct entity translation » Content translation "update" and "delete" entity operation access checks are not made on the correct entity translation
Issue summary: View changes
Issue tags: +Needs merge request

Work 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..