Issue Bug Closed

#110019Backend CSP lacks 'media-src 'self' data:' caused by inline media in backend.css / dashboard.css

Sam Lowry 06/08/26, 06:18 updated 06/10/26, 06:37

Description

Steps to reproduce:

1. Install a fresh instance of TYPO3 v14.3.2.
2. Log into the Backend using a modern, strict browser (like Firefox).
3. Access the TYPO3 Backend Login, the MFA (TOTP) view, or the Dashboard.

Expected result:

The Backend interface opens cleanly without any Content Security Policy (CSP) violations in the browser console.

Actual result:

Firefox blocks core assets and throws the following security errors in the console:
{quote}
Content-Security-Policy: The settings of the page blocked the loading of a resource (media-src) to data: because it violates the following directive: “default-src ‘self’”
{quote}

This error explicitly triggers on the backend entry view, the dashboard, and during the MFA validation screen.

Root cause:

The Core backend styles located in the generated dynamic folders:
  • `_assets/…/Css/backend.css`
  • `_assets/…/Css/dashboard.css`
  • `_assets/…/Css/webfonts.css`

contain embedded data-URLs for internal media components (such as short validation tracks or UI sound buffers via `url(“data:audio/…”)` or video properties).

However, the native CSP header generated by the TYPO3 v14 Core API completely lacks the `media-src` directive. Strict browsers are therefore forced to fall back to `default-src ‘self’`, which aggressively blocks these internal CSS assets from being parsed correctly.

Suggested fix:

Extend the default backend Content Security Policy rule-set inside the Core Framework API to natively include:
`media-src ‘self’ data:;`

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 6

  1. Garvin Hicking commented and changed category status New Needs Feedback <span data-processor="relativetime" data-value="2026-06-08T08:01:47+00:00" > 06/08/26, 08:01 </span>

    Could you say which directive exactly this triggers? To my knowledge we have neither video nor audio kn the Core. So it might be repated to a third part extension, or I have ‘t thoroughly skimmed through it ;)

    Thanks for taking the time to report!

  2. Sam Lowry commented <span data-processor="relativetime" data-value="2026-06-08T09:43:39+00:00" > 06/08/26, 09:43 </span>

    Maybe?

    main:
    <link rel="stylesheet" href="/_assets/081fa96a07de1dccb64a8a83e1567439/Css/backend.css" media="all" nonce="SlxKZoyTw2dxDcIaYnhrDbFhdPG1-VmZgghe7PFDngpZXAVn2yGCSg">
    <link rel="stylesheet" href="/_assets/081fa96a07de1dccb64a8a83e1567439/Css/webfonts.css" media="all" nonce="SlxKZoyTw2dxDcIaYnhrDbFhdPG1-VmZgghe7PFDngpZXAVn2yGCSg">
    <link rel="stylesheet" href="/_assets/37ee5ba7a97ad859ac99cb8181e0c0e3/Css/Modal/style.css" media="all" nonce="SlxKZoyTw2dxDcIaYnhrDbFhdPG1-VmZgghe7PFDngpZXAVn2yGCSg">

    dashboard:
    <link rel="stylesheet" href="/_assets/081fa96a07de1dccb64a8a83e1567439/Css/backend.css" media="all" nonce="3TWkirFTMOci2qBnmNJcW9JuhSPTtHB8d1fIdngKCFZWaWIxJUYZ-g">
    <link rel="stylesheet" href="/_assets/081fa96a07de1dccb64a8a83e1567439/Css/webfonts.css" media="all" nonce="3TWkirFTMOci2qBnmNJcW9JuhSPTtHB8d1fIdngKCFZWaWIxJUYZ-g">
    <link rel="stylesheet" href="/_assets/37ee5ba7a97ad859ac99cb8181e0c0e3/Css/dashboard.css" media="all" nonce="3TWkirFTMOci2qBnmNJcW9JuhSPTtHB8d1fIdngKCFZWaWIxJUYZ-g">

    Without a doubt:
    I use Caddy. My server block:

    example.com {
        root * ./www/com.example
        encode
        file_server
    
        php_fastcgi 127.0.0.1:9000
    
        header Content-Security-Policy "object-src 'none'" "object-src 'none'; media-src 'self' data:" {
            defer
        }
    }

    If I use this (it is a kind of replace function)

        header Content-Security-Policy "object-src 'none'" "object-src 'none'; media-src 'self' data:" {
            defer
        }

    to add media-src ‘self’ data:; to the CSP in Typo3, the errors disappear.

    You’re welcome.

  3. Garvin Hicking commented <span data-processor="relativetime" data-value="2026-06-08T18:48:58+00:00" > 06/08/26, 18:48 </span>

    Hi!

    Could you try this with a vanilla TYPO3 installation in a Firefox private window? I cannot reproduce this. Also I searched for all “data:” occurrences in the CSS files and all only referenced SVG images. Thus I believe it must either be a TYPO3 extension that utilizes this, or maybe even a browser extension that injects a panel into the site…

    Best regards,
    Garvin

  4. Sam Lowry commented <span data-processor="relativetime" data-value="2026-06-09T20:59:11+00:00" > 06/09/26, 20:59 </span>

    Hi Garvin!

    After a long search, I’ve found the culprit. It’s not typo3. It’s the Firefox add-on NoScript. It doesn’t alter the visible source code of the page in any way. But when I disable it, everything works perfectly. I’m sorry.

    Best regards,
    Sam

  5. Garvin Hicking commented and changed status Needs Feedback Closed <span data-processor="relativetime" data-value="2026-06-10T06:14:41+00:00" > 06/10/26, 06:14 </span>

    Hi Sam!

    Thanks for digging in – I was suspecting something like this. Sadly it’s sometimes very hard to find out what kind of operations browser extensions perform.

    I think in your case adding the media allowance into your output is good, but I would actually prefer to not have it in the TYPO3 core unless it’s really important. This also helps to keep default security more tightly under control.

    I’m closing the issue, I hope that’s fine with you!

    Regards,
    Garvin

  6. Sam Lowry commented <span data-processor="relativetime" data-value="2026-06-10T06:37:59+00:00" > 06/10/26, 06:37 </span>

    Hi Garvin,

    once again, sorry for the trouble I caused. You shouldn’t change anything in TYPO3; it’s running smoothly. It’s more of a matter for NoScript.

    I would have closed the ticket myself, but I get the impression I can’t do that (or I haven’t found how).

    Finally, some good news: TYPO3 runs smoothly with PHP 8.5.7.

    Over and out,
    Sam