Issue Bug Closed

#109633unsafe-inline csp-configuration ignored

Udo Klingner 04/17/26, 15:41 updated 04/24/26, 10:54

Description

Since version 13.4.27, “unsafe-inline” configurations from the csp.yaml are ignored and no longer work. 13.4.26 and 14.2.0 works fine.

Reviews 0

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

Files 1

History 18

  1. Oliver Hader commented <span data-processor="relativetime" data-value="2026-04-17T19:01:04+00:00" > 04/17/26, 19:01 </span>

    Could not reproduce with TYPO3 v13.4.28

    curl -sik https://ip13.anyhost.it/customize | head -n 9
    HTTP/1.1 200 OK
    Date: Fri, 17 Apr 2026 18:57:56 GMT
    Server: Apache/2.4.66 (Unix) OpenSSL/3.6.2 mod_fcgid/2.3.9
    X-Powered-By: PHP/8.2.30
    Content-Language: en-US
    Cache-Control: private, no-store
    Content-Security-Policy: default-src 'self'; script-src 'self' 'nonce-PC4Ms0tplpXAak58jRl5XmkAo7o-fTL1FgQlXXnIT_mq1lsBb6ldag' 'unsafe-inline' 'report-sample'; style-src-attr 'unsafe-inline' 'report-sample'; img-src 'self' data: *.ytimg.com *.vimeocdn.com; base-uri 'self'; frame-src 'self' *.youtube-nocookie.com *.youtube.com *.vimeo.com; style-src-elem 'self' 'nonce-PC4Ms0tplpXAak58jRl5XmkAo7o-fTL1FgQlXXnIT_mq1lsBb6ldag' 'report-sample'; report-uri https://ip13.anyhost.it/@http-reporting?csp=report&requestTime=1776452276891853&requestHash=31d75fdb000861a693e3c47fafbd5fb8fcd955a8
    Content-Length: 91188
    Content-Type: text/html; charset=utf-8

    The 'unsafe-inline' was added to script-src via csp.yaml, the rest stems from the defaults:

    enforce:
      inheritDefault: true
      includeResolutions: true
      mutations:
        - mode: extend
          directive: 'script-src'
          sources:
            - "'unsafe-inline'"

    Please provide more details/configuration helping me to reproduce your report locally. Thanks in advance!

  2. Udo Klingner commented <span data-processor="relativetime" data-value="2026-04-18T08:21:03+00:00" > 04/18/26, 08:21 </span>

    > Please provide more details/configuration helping me to reproduce your report locally. Thanks in advance!

    here is my example, with v13.4.27 or v13.4.28 i became this error:

    ‘Executing inline script violates the following Content Security Policy directive ‘script-src-elem ‘self’ ‘unsafe-inline’ ‘unsafe-eval’ blob: *.etracker.com *.etracker.de *.itzbund.de *.google.com *.googleapis.com data: *.amazonaws.com ‘sha256-nFwD4YsbarVb9t84tY4qNjbmGAZRp1+/l8SX1VuC/Rg=’ ‘report-sample’‘. Note that ‘unsafe-inline’ is ignored if either a hash or nonce value is present in the source list. The action has been blocked.’

    All inline javascriptpts no longer work.

    enforce:
      inheritDefault: true
      mutations:
        - mode: "set"
          directive: "script-src-elem"
          sources:
            - "'self'"
            - "'unsafe-inline'"
            - "'unsafe-eval'"
            - "blob:"
        - mode: "extend"
          directive: "script-src-elem"
          sources:
            - "*.etracker.com"
            - "*.etracker.de"
            - "*.itzbund.de"
            - "*.google.com"
            - "*.googleapis.com"
            - "data:"
            - "*.amazonaws.com"
  3. Udo Klingner commented <span data-processor="relativetime" data-value="2026-04-20T09:30:54+00:00" > 04/20/26, 09:30 </span>

    It seems the hash disables the unsafe-inline function. How can I disable these hashes?

  4. Garvin Hicking commented <span data-processor="relativetime" data-value="2026-04-20T18:09:14+00:00" > 04/20/26, 18:09 </span>

    Is this a GSB installation? IIRC these provide some patches/changes to the CSP implementation?

    Can you check your `typo3/module/system/config?tree=contentSecurityPolicyMutations` output and see which mutations are all enabled.

    And can you paste the HTML source of a page that triggers the CSP error please?

  5. Udo Klingner commented <span data-processor="relativetime" data-value="2026-04-21T09:53:39+00:00" > 04/21/26, 09:53 </span>

    Garvin Hicking wrote in #note-6:
    > Is this a GSB installation? IIRC these provide some patches/changes to the CSP implementation?
    This are normal typo3 v13 composer installations. No csp patches.

  6. Udo Klingner commented <span data-processor="relativetime" data-value="2026-04-21T12:43:56+00:00" > 04/21/26, 12:43 </span>

    Garvin Hicking wrote in #note-6:
    > And can you paste the HTML source of a page that triggers the CSP error please?

    Every page with a script tag in its code triggers the hash-unsafe-inline error message. I think the hash is the problem, as stated in the error message.

  7. Garvin Hicking commented <span data-processor="relativetime" data-value="2026-04-21T12:55:21+00:00" > 04/21/26, 12:55 </span>

    It would still help me to get the list of all mutations, and a HTML dump plus your HTTP CSP header to better understand so I can try to help.

    Or how to reproduce this with a blank, fresh TYPO3 instance.

  8. Garvin Hicking commented <span data-processor="relativetime" data-value="2026-04-21T12:59:51+00:00" > 04/21/26, 12:59 </span>

    Ah, I missed the screenshot, will investigate.

  9. Udo Klingner commented <span data-processor="relativetime" data-value="2026-04-21T13:47:21+00:00" > 04/21/26, 13:47 </span>

    Garvin Hicking wrote in #note-10:
    > It would still help me to get the list of all mutations, and a HTML dump plus your HTTP CSP header to better understand so I can try to help.
    >
    > Or how to reproduce this with a blank, fresh TYPO3 instance.

    I’ll have a test page activated; it might take a while…

  10. Udo Klingner commented <span data-processor="relativetime" data-value="2026-04-22T18:23:08+00:00" > 04/22/26, 18:23 </span>

    Garvin Hicking wrote in #note-10:
    > It would still help me to get the list of all mutations, and a HTML dump plus your HTTP CSP header to better understand so I can try to help.
    >
    > Or how to reproduce this with a blank, fresh TYPO3 instance.

    Here is a testpage:
    URL: https://bundesprogramm13.dev.se.ble.de
    User: bundesprogramm13_dev
    Passwort: >1XAi1y`5E&8DuA2f2jl4w%y`1rd)XYX

    The error triggers at the start page:
    Executing inline script violates the following Content Security Policy directive ‘script-src-elem ‘self’ ‘unsafe-inline’ ‘unsafe-eval’ blob: *.etracker.com *.etracker.de *.itzbund.de *.google.com *.googleapis.com data: *.amazonaws.com ‘sha256-WNiPuXDCSwQ/IgxunRZ0qd3xN1kbNO3KFuKc5/VPfb8=’ ‘report-sample’‘. Note that ‘unsafe-inline’ is ignored if either a hash or nonce value is present in the source list. The action has been blocked.

  11. Udo Klingner commented <span data-processor="relativetime" data-value="2026-04-22T18:28:11+00:00" > 04/22/26, 18:28 </span>

    Additional Information: We are in a government agency behind a proxy

  12. Udo Klingner commented <span data-processor="relativetime" data-value="2026-04-23T06:34:34+00:00" > 04/23/26, 06:34 </span>

    I’ve discovered that the bug is triggered in proxy and mobile networks. The new nonce hash is a breaking change for websites with inline JavaScript and shouldn’t be implemented in an LTS version without the option to disable it. We have over 30 TYPO3 instances and can no longer update.

  13. Garvin Hicking commented <span data-processor="relativetime" data-value="2026-04-23T15:41:50+00:00" > 04/23/26, 15:41 </span>

    Hm I just opened your page. I get no CSP errors? The HTTP header that your site emits is:

    default-src 'self'; script-src 'self' 'report-sample'; style-src-attr 'unsafe-inline' 'report-sample'; img-src 'self' data: *.ytimg.com *.vimeocdn.com *.amazonaws.com https://*.googleapis.com https://*.gstatic.com *.google.com *.googleusercontent.com *.googleapis.com *.gstatic.com *.ble-medienservice.de; base-uri 'self'; frame-src 'self' *.youtube-nocookie.com *.youtube.com *.vimeo.com *.google.com *.contentflow.net; script-src-elem 'self' 'unsafe-inline' 'unsafe-eval' blob: *.etracker.com *.etracker.de *.itzbund.de *.google.com *.googleapis.com data: *.amazonaws.com 'report-sample'; connect-src 'self' *.google.com https://*.googleapis.com https://*.gstatic.com blob: data: *.etracker.com *.etracker.de *.itzbund.de *.googleapis.com; font-src 'self' https://fonts.gstatic.com; style-src-elem 'self' https://maps.google.com https://fonts.gstatic.com *.google.com https://fonts.googleapis.com 'unsafe-inline' *.googleapis.com 'report-sample'; worker-src 'self' blob: 'report-sample'; report-uri https://bundesprogramm13.dev.se.ble.de/@http-reporting?csp=report&requestTime=1776958486582106&requestHash=e04c71f7deda2be0f525d7eb9295c5bd99a968ad

    To me this feels like your own proxy is injecting javascript into the site? I’d really like to help but for it I’d first have to be able to easily reproduce this, because there many moving parts involved that can affect this.

    I don’t see any commit in 13.4.27 that should be related to your problem (or do you mean 13.4.28?). The only one that touches CSP is this one:

    https://github.com/TYPO3/typo3/commit/459e76bb01e19a9eeb80d0bb9adeae011ca984cb

    but I’m not sure yet how that would trigger. Please feel free to revert that commit to see if it fixes things for you.

  14. Udo Klingner commented <span data-processor="relativetime" data-value="2026-04-24T07:25:53+00:00" > 04/24/26, 07:25 </span>

    Hi Garvin, we found the problem; a proxy service was misconfigured. Sorry for the confusion and thanks for your help. The issue can be closed.

  15. Georg Ringer commented and changed status Needs Feedback Closed <span data-processor="relativetime" data-value="2026-04-24T10:54:54+00:00" > 04/24/26, 10:54 </span>

    closed as requested