StringFormatter always displays links to entity even if the user in context does not have access

Created on 27 January 2023, almost 2 years ago
Updated 14 August 2024, 4 months ago

Problem/Motivation

This was reported privately and the security team deemed it could be solved in public
\Drupal\Core\Field\Plugin\Field\FieldFormatter\StringFormatter renders a link regardless of whether the user in context has access.

Steps to reproduce

Use a StringFormatter formatter where the related entity is inaccessible to the user. Presently, a link will be displayed. If the user attempts to navigate to it they may reach a 403.

Proposed resolution

MR 8317 is for 11.x

Display a plain text for the linked entity when the user in context does not have access.

StringFormatter already has a textual fallback for when the entity does not have a canonical template or link_to_entity setting is off.

Remaining tasks

Implement.

User interface changes

Text link may be displayed when user does not have access.

API changes

It may be necessary to install the user entity and add a default user for tests.

Data model changes

None.

Release notes snippet

πŸ› Bug report
Status

RTBC

Version

11.0 πŸ”₯

Component
FieldΒ  β†’

Last updated about 21 hours ago

Created by

πŸ‡¦πŸ‡ΊAustralia dpi Perth, Australia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024