Issue Bug Under Review

#111571Preview module blocks links in the frame when the site uses another host than the backend

Matthias Vogel 11/25/26, 08:21 updated 11/25/26, 08:24

Description

The backend module “Content > Preview” shows the page in an iframe. It adds the full URI of the page, with path and query, to the CSP directive frame-src. A CSP source with a path allows only this one path. A query is not valid in a CSP source.

Steps: backend on https://backend.example.com/typo3/, site base on https://www.example.org/. Open “Content > Preview” for a page that is not the root page. Click a link to another page of the same site in the frame.

Actual: the browser blocks the navigation (“Framing … violates … frame-src ‘self’ … https://www.example.org/subpage”). With mod.web_view.type or access restrictions the source also has a query, and Chrome warns about an invalid path.

Expected: links to other pages on the same host open in the frame. Cause: ViewModuleController adds UriValue::fromUri($targetUri). Fix: add only the origin.

Reviews 1

History 12

  1. Matthias Vogel changed Related to #110312 11/25/26, 08:21

  2. Gerrit Code Review pushed patch set 1 for main to change 97995 status New Under Review 11/25/26, 08:24