Study guide · Security and CSP

Securing TYPO3, from the Security Team to the Content Security Policy

As of November 16, 2026 · TYPO3 14.3 LTS · about 25 min read

A TYPO3 website is only as secure as its weakest point. That can be a guessed password, a forgotten update or an injected script. On this page you secure a website step by step: from handling security issues and backend accounts to the Content Security Policy, CSP for short.

The example is the website of the Lindenau Music School. The integrator Mara builds it with TYPO3 14.3 and the site package lindenau_site. Nobody should get into the backend with a guessed password, and a concert video should play on the home page without the security rules blocking it.

The TYPO3 Security Team

If you find a security issue in the TYPO3 Core or in an extension, you report it only to the TYPO3 Security Team. The address is security at typo3 dot org. You do not make it public, not in a forum, on Slack or in the TER. As long as there is no fix, that would put every affected website at risk.

The team strives to answer within two working days. For an issue in the Core, the experts for the affected component build the fix, and the update is released together with a public security announcement. For an extension, the team asks the author for a fix, reviews it, prepares the announcement and coordinates the date. The author may only upload the new version after the team gives the go-ahead.

This also applies to your own extension. If Mara finds an issue in an extension she published in the TER herself, she still reports it to the Security Team. She does not upload the fix right away or describe the issue in the changelog in advance, otherwise attackers would exploit it.

If an author does not deliver a fix in reasonable time, the team removes all affected versions from the TER and recommends uninstalling the extension in an announcement. This also covers unmaintained extensions. The team does not touch running installations.

What the team does not do: it does not review individual extensions or websites, and there is no review of every extension before it reaches the TER. For a security audit, turn to an experienced agency or a TYPO3 partner.

Security Bulletins are the official security announcements. They appear on typo3.org in the Security section, and the TYPO3 Announce mailing list announces them as well. Each bulletin has a unique identifier made of its type, the year and a running number:

  • Core bulletins are named, for example, TYPO3-CORE-SA-2026-001.
  • Extension bulletins are named, for example, TYPO3-EXT-SA-2026-001.

Hardening accounts and configuration

The backend accounts follow the principle of least privilege: each person gets only the permissions they really need. If an account is taken over, an attacker can only do as much damage as the account allows.

Mara creates a separate account for each person. Generic names like “admin” are easy to guess. Real names are better, for example firstname dot lastname.

The file settings.php, also editable through the Install Tool, offers more settings:

  • fileDenyPattern in the BE section is a regular expression. Nobody can upload or rename matching file names. By default it matches, among others, PHP variants, phtml, phar, CGI and Perl scripts and the htaccess file.
  • IPmaskList in the BE section is a list of allowed IP addresses or networks. Any backend activity is only possible from there, for example only from the office network.
  • devIPmask in the SYS section, in contrast, only controls who sees debug output.
  • warning_email_addr in the BE section names an address for warnings. warning_mode decides when an email is sent on login: with 1 on every backend login, with 2 only on admin logins.

The same address also receives notices about logins to the Install Tool. It also gets a warning when more than three backend logins fail within one hour.

Why is lockIP off? The setting lockIP binds a session to the IP address. For backend sessions it is 0 by default. Modern networks often switch between IPv4 and IPv6, a technique called Happy Eyeballs. Proxies change the IP as well. With IP locking, users would be logged out again and again, so you only switch it on deliberately.

Two backend modules belong to regular checks:

  • The module Administration, Log shows entries from the table sys_log, including logins, logouts and failed login attempts.
  • The module Administration, Reports contains the status report. Its Security section is especially important. In TYPO3 14.3 it checks, among other things, the encrypted connection, the trusted hosts pattern, the fileDenyPattern and the protection of the Install Tool.

The way into the backend is not fixed. By default, the backend lives under the path typo3. With the setting entryPoint in the BE section, you choose a different path like admin or a full URL with its own domain or subdomain. Since TYPO3 14, the Install Tool follows the entry point automatically, so with the path admin it lives under admin, install.

Writing safe TypoScript, and the emergency

TypoScript can open a hole too. With the object CONTENT, which fetches records with a query, values from GET or POST must never reach the where text unchecked.

lib.unsafe = CONTENT
lib.unsafe.table = tt_content
lib.unsafe.select.where = uid = {GP:id}
lib.unsafe.select.insertData = 1
Unsafe example. The where condition compares the uid with the parameter id from the URL. With insertData, the value is inserted straight into the text of the query.

Here the value from the URL ends up unchecked in the SQL query. An attacker can inject their own SQL through the parameter id. This is called SQL injection. The safe way is a placeholder with select.markers. TYPO3 then escapes the value, converts numbers and puts text in quotes.

lib.safe = CONTENT
lib.safe.table = tt_content
lib.safe.select.where = uid = ###ID###
lib.safe.select.markers.ID.data = GP:id
Safe example. The where condition contains the placeholder ID between three hash signs on each side. Under select.markers, the placeholder ID is filled with the parameter id from the URL, and TYPO3 escapes the value.

Mara sets two more protections with TypoScript:

  • Against clickjacking, she uses config.additionalHeaders to send the header X-Frame-Options with the value SAMEORIGIN. Then only the same domain may embed the pages in frames. The CSP directive frame-ancestors has the same goal.
  • Against tampered third-party scripts, an externally hosted JavaScript in page.includeJS gets the property integrity with a hash. This is called Subresource Integrity, SRI for short. The browser only loads the file if its content matches the hash. Since TYPO3 14.2, the value auto computes the hash for you. For third-party servers, a fixed hash is still safer.
config.additionalHeaders.10.header = X-Frame-Options: SAMEORIGIN

page.includeJS.calendar = https://cdn.example.org/calendar.js
page.includeJS.calendar.external = 1
page.includeJS.calendar.integrity = sha384-...
Code example. The first entry sends the header X-Frame-Options with the value SAMEORIGIN. Below it, page.includeJS includes an external script, marks it as external and gives a SHA-384 hash with integrity.

And if it happens anyway? Suppose foreign code suddenly appears in the file index.php. Then deleting that line is not enough, because attackers often leave further back doors. Do not keep the website online to watch the attacker either.

  1. Take the website offline and save a copy for analysis.
  2. Find out how the attacker got in.
  3. Restore from a clean backup and bring TYPO3 and all extensions to current versions.
  4. Change all passwords, including those for the database, the server and the Install Tool.

A second factor: MFA

Multi-factor authentication, MFA for short, helps against guessed passwords. On top of the password, something you know, comes something you own, such as a smartphone. MFA does not replace the password, it adds to it.

The Core ships two providers:

  • TOTP stands for time-based one-time password. You connect an authenticator app with a QR code. It shows a new six-digit code every 30 seconds.
  • Recovery codes are a fallback. If the smartphone is gone, one of these codes gets you into the backend once more. They can only be set up when another provider is already active.

SMS, email codes or hardware keys are not part of the Core, but extensions can add such providers. Each user sets up MFA in the “User Settings” module, on the “Account security” tab, and can deactivate a provider there. An admin can switch MFA off in the user's record. After three wrong codes in a row, TYPO3 locks the provider. Since TYPO3 14, the user also gets an email after a failed MFA attempt, provided their account has a valid address.

Making MFA mandatory works globally with the setting requireMfa in the BE section. It knows five values:

  • 0 means not required. This is the default.
  • 1 means required for all backend users.
  • 2 means required only for users without admin rights.
  • 3 means required only for admins.
  • 4 means required only for system maintainers.

For individual users or groups, there is the option auth.mfa.required in User TSconfig. It takes precedence over the global setting, in both directions. With 1 it requires MFA, with 0 it lifts the requirement.

Which providers are allowed is controlled by the user group with the field “Allowed multi-factor authentication providers”. It used to sit on the “Access Lists” tab, in TYPO3 14 it is on the “General” tab, in the “Authentication” section. With auth.mfa.disableProviders in User TSconfig, you block a provider for users or groups, even if the group allows it. The setting recommendedMfaProvider in the BE section recommends a provider during setup, totp by default. Per user or group, auth.mfa.recommendedProvider does the same.

Password policies

TYPO3 checks new passwords against a password policy. The policy default applies to backend and frontend accounts. The Install Tool has its own policy called installTool.

The policy default contains two validators:

  • The CorePasswordValidator requires at least 8 characters. It also wants upper and lower case letters, a digit and a special character.
  • The NotCurrentPasswordValidator prevents someone from setting their current password again.

When a new user is created, the second validator does not apply. In the policy, the action NEW_USER_PASSWORD is listed under excludeActions for it, because a new user has no current password yet. The CorePasswordValidator, in contrast, also checks new passwords.

The policies themselves live under SYS/passwordPolicies in the global configuration. The settings passwordPolicy in the BE and FE sections only select the name of a policy, not a length. Custom policies typically go into the file additional.php.

$GLOBALS['TYPO3_CONF_VARS']['SYS']['passwordPolicies']['lindenau'] = [
    'validators' => [
        CorePasswordValidator::class => [
            'options' => [
                'minimumLength' => 12,
                'upperCaseCharacterRequired' => true,
                'lowerCaseCharacterRequired' => true,
                'digitCharacterRequired' => true,
                'specialCharacterRequired' => false,
            ],
        ],
        NotCurrentPasswordValidator::class => [
            'excludeActions' => [PasswordPolicyAction::NEW_USER_PASSWORD],
        ],
    ],
];
$GLOBALS['TYPO3_CONF_VARS']['BE']['passwordPolicy'] = 'lindenau';
Code example in the file additional.php. The new policy lindenau requires 12 characters, upper and lower case letters and a digit, but no special character. The last line selects it for the backend.

In the CorePasswordValidator, checks that are not set count as off. That is why Mara lists every character type she wants explicitly.

What a Content Security Policy is

The Content Security Policy is a web standard. With it, the website tells the browser from which sources it may load scripts, styles, images or frames. The browser blocks everything else. Above all, this makes cross-site scripting, XSS for short, harder, as well as clickjacking and other injected content.

The rules come from the server as an HTTP header, not as a cookie, a file or an HTML comment. There are two kinds, called dispositions:

  • The header Content-Security-Policy enforces the rules. The browser blocks whatever is not allowed.
  • The header Content-Security-Policy-Report-Only only reports. The browser checks the rules and reports violations, but blocks nothing.

You see every block first in the browser console, and the browser can also send reports to a server. With Report-Only, you test a new policy safely before you enforce it.

A policy consists of directives. Each directive covers one kind of content and lists allowed sources. script-src applies to scripts, img-src to images and frame-src to iframes. Sources are addresses or keywords like self for your own domain.

Many directives inherit. If frame-src is missing, child-src applies. If that is missing too, default-src applies. But if frame-src is set, only it applies. You then have to repeat sources from default-src there.

Which directive applies to an iframe? frame-src child-src default-src missing? missing? If frame-src is set, only frame-src applies. Example Policy default-src 'self' iframe youtube.com blocked, violation reported
If a directive is missing, the browser asks the next one in the chain.

A CSP is only an additional layer of protection in the browser. It replaces neither escaping in Fluid nor clean database queries. It does not help against SQL injection or brute force attacks. The keyword unsafe-inline weakens the protection considerably, because every injected inline script would be allowed again.

For allowed inline scripts there is a better way, the nonce. The word stands for “number used once”. It is a random value that the server creates anew for every request. It appears in the header and on the allowed script. Injected code does not know the nonce and is blocked.

Switching on and adjusting CSP in TYPO3

In the backend, the CSP is always active in TYPO3. In the frontend, it is off by default. You switch it on in one of two ways:

  • With one of two feature toggles, one for enforcing and one for reporting. Both are off by default.
  • Or with a site file csp.yaml that sets the enforce or report section.
security.frontend.enforceContentSecurityPolicy
security.frontend.reportContentSecurityPolicy
The two feature toggles. The first is called security dot frontend dot enforceContentSecurityPolicy and enforces the CSP. The second is called security dot frontend dot reportContentSecurityPolicy and only reports.

The file csp.yaml sits next to config.yaml in the site's folder, for Mara in config/sites/lindenau. It only applies to the frontend of this site. With inheritDefault set to true, it inherits the default policy from the Core and extensions. It already allows YouTube and Vimeo in frame-src. So the school video on YouTube plays without an extra rule.

A video from the partner concert hall, however, comes from its own player. For that, Mara adds a mutation:

enforce:
  inheritDefault: true
  mutations:
    - mode: "extend"
      directive: "frame-src"
      sources:
        - "https://player.example.org"
Code example csp.yaml. Under enforce, the policy inherits the default rules. A mutation in the mode extend adds the address of the video player, player dot example dot org, to the directive frame-src.

Every mutation has a mode. It says how the mutation affects the directive:

  • set sets a directive anew and replaces all previous sources.
  • append adds sources to a directive.
  • extend inherits from the ancestor directive and then adds. It is a shortcut for inherit-once and append.
  • inherit-once takes over the sources of the ancestor chain only if the directive is not set yet. inherit-again does so even then and merges them with the existing ones.
  • reduce removes individual sources.
  • remove deletes a directive completely.

With active set to false in csp.yaml, you switch off the CSP of a site completely.

Rules for the backend do not belong in csp.yaml. If lindenau_site ships its own backend module, Mara puts the rules into the file ContentSecurityPolicies.php in the extension's Configuration folder, using PHP. There, every group of rules belongs to a scope, frontend or backend.

return Map::fromEntries([
    Scope::backend(),
    new MutationCollection(
        new Mutation(MutationMode::Extend, Directive::ImgSrc, new UriValue('https://cdn.example.org')),
    ),
]);
Code example ContentSecurityPolicies.php. The file returns a map. For the scope backend, a mutation in the mode Extend adds the address cdn dot example dot org to the directive img-src.
Where do the rules come from? Default policy Core and extensions ContentSecurityPolicies.php Extension, with scope csp.yaml Site, frontend only Resolutions from the module Table sys_csp_resolution Policy mutations HTTP header to the browser
Where TYPO3 takes the rules of a policy from.

Finding and resolving violations

Before Mara enforces the policy, she tests with report. The browser then reports violations to the TYPO3 endpoint. TYPO3 stores them in the table sys_http_report, not in a log file and not in sys_log.

Reported violations appear in the backend module System, Content Security Policy. Since TYPO3 14 it sits in the System section, and system maintainers may use it. A click on an entry shows details and a suggested resolution. You can apply the suggestion, mute the violation or delete it.

If a violation for the partner's video shows up there, Mara has two options:

  • She applies the suggested resolution in the module. It is stored in the table sys_csp_resolution and extends the policy at runtime.
  • She adds a mutation for frame-src to csp.yaml. That is permanent and versioned, because the file lives in the Git project.

Mara takes the second way, so that all rules are in one place. Applied resolutions cannot be removed in the module, only directly in the database. Wrong options would be switching the CSP off in the editor's browser or adding unsafe-eval to script-src. That keyword concerns the JavaScript function eval, not iframes.

Per site, you control the endpoint with reportingUrl in the enforce or report section:

  • With true, the built-in endpoint accepts reports.
  • With false, it accepts no reports, and calls get the response 403. The CSP itself stays active.
  • A text value counts as the address of an external service that the browser sends the reports to.

The site setting takes precedence over the global setting contentSecurityPolicyReportingUrl in the BE and FE sections. Globally, the value 0 switches the endpoint off.

Nonces, hashes and caching

Nonces are new for every request. So a reverse proxy cannot cache a page with a nonce, because the cache would deliver the same nonce several times and defeat the protection.

Since TYPO3 14.2 there is an alternative: hash values instead of nonces. While rendering, TYPO3 collects checksums of the scripts and styles. A hash is the same for every request, so the page stays cacheable. You switch this on per site in the behavior section of csp.yaml:

behavior:
  useHash: true
  useNonce: false

enforce:
  inheritDefault: true
  includeResolutions: true
Code example csp.yaml. Under behavior, useHash is true and useNonce is false. Below that, the enforce section inherits the default rules and includes applied resolutions.

With useHash set to true, TYPO3 collects the hashes and adds them to the policy. With useNonce set to false, it removes the nonce sources, because as long as a nonce is in the policy, every response is unique. A site without behavior keeps using nonces.

Nonce Hash Request 1 nonce-a8Fq… Request 2 nonce-Zk3P… Reverse proxy cannot cache TYPO3 renders every time Request 1 sha256-6c7d… Request 2 sha256-6c7d… Reverse proxy caches the page TYPO3 renders once behavior: useHash true, useNonce false in the site's csp.yaml, since TYPO3 14.2
A nonce makes every response unique, a hash does not.

TYPO3 hashes three kinds of content:

  • For inline scripts and inline styles, it hashes the content of the element with SHA-256.
  • For script and style files, it takes the value of the integrity attribute, otherwise a hash of the file content.
  • It covers style attributes when they are registered with the ViewHelper f:asset.styleAttr.

In Fluid, the argument csp of the ViewHelpers f:asset.script and f:asset.css decides whether an asset gets a hash or a nonce. For files it is true by default. For inline code it is false by default, so you have to switch it on explicitly. Since TYPO3 14.2 it replaces the old argument useNonce, which is now deprecated.

The new ViewHelper f:asset.styleAttr hashes the value of a style attribute. That way it covers the directive style-src-attr without needing unsafe-inline. Its argument csp is also true by default. You get the nonce itself in Fluid with the ViewHelper f:security.nonce.

<f:asset.script identifier="coursefilter" csp="1">
    document.querySelector('.filter').classList.add('active');
</f:asset.script>

<div style="{f:asset.styleAttr(value: 'color: green')}">Registration open</div>
Fluid code example. An inline script with the identifier coursefilter switches csp on explicitly. Below it, a div gets a style attribute with a green text color through the ViewHelper f:asset.styleAttr.

Key points

  • You report security issues only to the TYPO3 Security Team, even for your own extension. A new version is only released after the team's go-ahead.
  • Without a fix, the team removes affected versions from the TER. It does not audit individual extensions.
  • fileDenyPattern blocks dangerous file names, IPmaskList limits the backend to networks, warning_mode reports logins by email.
  • In TypoScript, values from the URL only get into a query through select.markers.
  • The Core ships TOTP and recovery codes. requireMfa makes MFA mandatory globally, auth.mfa.required in User TSconfig takes precedence.
  • The policy default requires 8 characters with all character types and rejects the current password.
  • In the frontend, feature toggles or the site's csp.yaml switch the CSP on. Backend rules come from an extension via PHP.
  • Violations are stored in sys_http_report, applied resolutions in sys_csp_resolution.
  • Nonces prevent caching. Since 14.2 there are hashes, with useHash and useNonce in the behavior section.

Terms

Security Bulletin
Official security announcement for the Core or an extension on typo3.org.
fileDenyPattern
Regular expression that blocks dangerous file names for upload and renaming.
SQL injection
Attack in which an input changes the database query.
Subresource Integrity
Hash in the integrity attribute that lets the browser check a third-party file.
TOTP
Time-based one-time password that changes every 30 seconds.
Recovery codes
One-time codes as a fallback when the main provider is missing.
Directive
Rule of a policy for one kind of content, for example frame-src for iframes.
Mutation
Change to a directive with a mode such as set, extend or remove.
Nonce
Random value per request that marks allowed inline scripts.
Hash
Checksum of allowed content, the same for every request.

As of: November 16, 2026 (TYPO3 14.3 LTS)

Sources:

  • TYPO3 Explained 14.3, chapters Security Team, Security guidelines, Multi-factor authentication, Password policies, Backend entry point and Content Security Policy
  • TSconfig Reference 14.3, auth.mfa
  • Source code TYPO3 14.3 (typo3/cms-core, cms-backend, cms-frontend, cms-fluid, cms-reports), checked for default values, required MFA, password policy, status report, module locations and CSP behavior
  • Changelog TYPO3 14.0 and 14.2, email on failed MFA, Install Tool follows the entry point, hash values instead of nonces, integrity auto
  • Learning objectives TYPO3 CMS Certified Integrator 14 LTS, area Security

This study guide was written with AI and checked against the sources.

Certifications & exams

Which exam comes next?

You can already practise for 51 exams, and 16 are up for a vote. See all certifications with their official information, cast your vote or suggest your exam.

See all certifications