8.0high
Cross-Site Scripting in TYPO3 Fluid
- Severity
- 8.0high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 1.04% (higher than 64% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-hpjm-3ww5-6cpf
Description
TYPO3 Fluid before versions 2.0.8, 2.1.7, 2.2.4, 2.3.7, 2.4.4, 2.5.11 and 2.6.10 is vulnerable to Cross-Site Scripting. Three XSS vulnerabilities have been detected in Fluid: 1. TagBasedViewHelper allowed XSS through maliciously crafted additionalAttributes arrays by creating keys with attribute-closing quotes followed by HTML. When rendering such attributes, TagBuilder would not escape the keys. 2. ViewHelpers which used the CompileWithContentArgumentAndRenderStatic trait, and which declared escapeOutput = false, would receive the content argument in unescaped format. 3. Subclasses of AbstractConditionViewHelper would receive the then and else arguments in unescaped format. Update to versions 2.0.8, 2.1.7, 2.2.4, 2.3.7, 2.4.4, 2.5.11 or 2.6.10 of this typo3fluid/fluid package that fix the problem described. More details are available in the linked advisory.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| TYPO3 Fluid | >= 2.0.0, < 2.0.8, >= 2.1.0, < 2.1.7, >= 2.2.0, < 2.2.4, >= 2.3.0, < 2.3.7, >= 2.4.0, < 2.4.4, >= 2.5.0, < 2.5.11, >= 2.6.0, < 2.6.10, before 2.0.8 and 6 more | CVE List, NVD |
| typo3fluid/fluid (Packagist) | from 2.0.0 before 2.0.8, from 2.1.0 before 2.1.7, from 2.2.0 before 2.2.4, from 2.3.0 before 2.3.7, from 2.4.0 before 2.4.4, from 2.5.0 before 2.5.11, from 2.6.0 before 2.6.10 | GitHub Advisory Database |
All scores
| GitHub_M | 8.0high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:N |
| GitHub | 8.0high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:N |
| NVD | 6.1medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| NVD | 4.3medium CVSS:2.0 | AV:N/AC:M/Au:N/C:N/I:P/A:N |
Classification
What each source says
CVE List
TYPO3 Fluid before versions 2.0.8, 2.1.7, 2.2.4, 2.3.7, 2.4.4, 2.5.11 and 2.6.10 is vulnerable to Cross-Site Scripting. Three XSS vulnerabilities have been detected in Fluid: 1. TagBasedViewHelper allowed XSS through maliciously crafted additionalAttributes arrays by creating keys with attribute-closing quotes followed by HTML. When rendering such attributes, TagBuilder would not escape the keys. 2. ViewHelpers which used the CompileWithContentArgumentAndRenderStatic trait, and which declared escapeOutput = false, would receive the content argument in unescaped format. 3. Subclasses of AbstractConditionViewHelper would receive the then and else arguments in unescaped format. Update to versions 2.0.8, 2.1.7, 2.2.4, 2.3.7, 2.4.4, 2.5.11 or 2.6.10 of this typo3fluid/fluid package that fix the problem described. More details are available in the linked advisory.
GitHub Advisory Database
Meta
- CVSS:
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N/E:F/RL:O/RC:C(5.7)- CWE-79
Problem
Three XSS vulnerabilities have been detected in Fluid:
- TagBasedViewHelper allowed XSS throug maliciously crafted
additionalAttributesarrays by creating keys with attribute-closing quotes followed by HTML. When rendering such attributes, TagBuilder would not escape the keys. - ViewHelpers which used the
CompileWithContentArgumentAndRenderStatictrait, and which declaredescapeOutput = false, would receive the content argument in unescaped format. - Subclasses of AbstractConditionViewHelper would receive the
thenandelsearguments in unescaped format.
Solution
Update to versions 2.0.8, 2.1.7, 2.2.4, 2.3.7, 2.4.4, 2.5.11 or 2.6.10 of this typo3fluid/fluid package that fix the problem described.
Updated versions of this package are bundled in following TYPO3 (typo3/cms-core) releases:
- TYPO3 v9.5.23 (using typo3fluid/fluid v2.6.10)
- TYPO3 v10.4.10 (using typo3fluid/fluid v2.6.10)
The specific vulnerabilities are prevented by:
- Explicitly escaping keys found in the
additionalAttributesarray passed to a TagBasedViewHelper before using them as attribute names. - Detecting "content argument" on ViewHelpers using the trait CompileWithContentArgumentAndRenderStatic and escaping it based on the state of
escapeChildrenwhenescapeOutputis toggled off. Escaping still will not occur if explicitly disabled by an enclosing ViewHelper. This homogenises escaping behavior of "content arguments" so the same strategy is used whether the "content" argument is passed as argument or child content. - Explicitly defining the
thenandelsearguments on AbstractConditionViewHelper subclasses as escaped and applying escaping in all cases where escaping is not explicitly disabled by an enclosing ViewHelper.
Affected cases
- The fix for TagBasedViewHelper does not affect any valid use cases; it only prevents use of maliciously crafted attribute/value arrays passed as
additionalAttributes. - Any case where a ViewHelper with a "content argument" and which defines
escapeOutput = falseis used with the content argument instead of passing variables as child node - e.g.<v:h content="{variable}" />instead of<v:h>{variable}</v:h>to intentionally circumvent escaping of any HTML in{variable}. - Any case where a condition ViewHelper is used with
thenorelsearguments to render a variable containing HTML, excluding cases where the variable is intentionally unescaped - e.g.<f:if condition="1" then="{variable -> f:format.raw()}" />, and excluding any cases where a ViewHelper is used as argument value and the ViewHelper intentionally disables escaping - e.g.<f:if condition="1" then="{f:render(section: 'MySection')}" />does not escape thethenargument becausef:renderdisables output escaping.
Cases 2 and 3 can be mitigated to allow variables with HTML to not be escaped, by intentionally disabling escaping by chaining the variable used in the argument with f:format.raw as described in case 3. Note that this constitutes a potential security issue, for which the template author is solely responsible. Example: <f:if condition="1" then="{intentionalHtmlVariable}" /> can allow HTML in {intentionalHtmlVariable} by adding -> f:format.raw() - to become <f:if condition="1" then="{intentionalHtmlVariable -> f:format.raw()}" />.
Custom ViewHelpers which use CompileWithContentArgumentAndRenderStatic can alternatively pass a 6th argument with value false to the call to registerArgument which registers the "content argument", which explicitly disables escaping of the argument value: $this->registerArgument('arg', 'string', 'My argument', false, null, false);. Note that this constitutes a potential security issue for which the ViewHelper author is solely responsible. Variables containing HTML should only be allowed after taking great care to prevent XSS through other means, e.g. sanitising the variable before it is assigned to Fluid or only allowing such variables to come from trusted sources.
Credits
Thanks to Jonas Eberle and Sinan Sekerci (Dreamlab Technologies) who reported this issue and to TYPO3 core merger Claus Due who fixed the issue.
References
NVD (es)
TYPO3 Fluid anterior a versiones 2.0.8, 2.1.7, 2.2.4, 2.3.7, 2.4.4, 2.5.11 y 2.6.10, es vulnerable a un ataque de tipo Cross-Site Scripting. Se han detectado tres vulnerabilidades de tipo XSS en Fluid: 1. TagBasedViewHelper permitía un ataque de tipo XSS por medio de matrices de additionalAttributes creadas maliciosamente mediante la creación de claves con comillas de cierre de atributos seguidas de HTML. Al representar tales atributos, TagBuilder no escapaba de las claves. 2. ViewHelpers que usaba el rasgo CompileWithContentArgumentAndRenderStatic, y que declaraba escapeOutput = false, recibirían el argumento de contenido en formato sin escape. 3. Las subclases de AbstractConditionViewHelper recibirían los argumentos then y else en formato sin escape. Actualice a las versiones 2.0.8, 2.1.7, 2.2.4, 2.3.7, 2.4.4, 2.5.11 o 2.6.10 de este paquete typo3fluid/fluid que corrige el problema descrito. Mas detalles están disponibles en el aviso vinculado
References
| https://github.com/TYPO3/Fluid/security/advisories/GHSA-hpjm-3ww5-6cpf | exploit, third-party-advisory, web | |
| https://github.com/TYPO3/Fluid/commit/f20db4e74cf9803c6cffca2ed2f03e1b0b89d0dc | patch, third-party-advisory, web | |
| https://typo3.org/security/advisory/typo3-core-sa-2020-009 | exploit, vendor-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2020-26216 | advisory | |
| https://github.com/FriendsOfPHP/security-advisories/blob/master/typo3fluid/fluid/CVE-2020-26216.yaml | web | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2020-26216 changed 2024-08-04 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-hpjm-3ww5-6cpf changed 2026-07-08 | CC-BY-4.0 |
| NVD | CVE-2020-26216 changed 2026-06-17 | Public domain |