Program: CWE-79
Project: CVE-2021-21365
Buggy source:
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:link.typolink parameter="{item.data.link}" additionalAttributes="{draggable:'false'}">
    <div class="valign">
        <div class="carousel-text vcontainer" {f:if(condition: item.data.text_color,then: 'style="color: {item.data.text_color};"')}>
            <h{item.data.header_layout} class="carousel-header{f:if(condition: item.data.header_class, then: ' {item.data.header_class}')}{f:if(condition: item.data.header_position, then: ' text-{item.data.header_position}')}"><f:format.htmlentitiesDecode>{item.data.header}</f:format.htmlentitiesDecode></h{item.data.header_layout}>
            <f:if condition="{item.data.subheader}">
                <h{item.data.subheader_layout} class="carousel-subheader{f:if(condition: item.data.subheader_class, then: ' {item.data.subheader_class}')}{f:if(condition: item.data.header_position, then: ' text-{item.data.header_position}')}"><f:format.htmlentitiesDecode>{item.data.subheader}</f:format.htmlentitiesDecode></h{item.data.subheader_layout}>
            </f:if>
            <f:format.html>{item.data.bodytext}</f:format.html>
        </div>
        <div class="carousel-image vcontainer">
            <f:if condition="{item.images.0}">
                <f:variable name="imageConfig">{settings.responsiveimages.contentelements.{data.CType}}</f:variable>
                <f:variable name="imageConfig">{imageConfig.{item.data.item_type}}</f:variable>
                <bk2k:data.imageVariants as="variants" variants="{variants}" multiplier="{imageConfig.multiplier}" gutters="{imageConfig.gutters}" corrections="{imageConfig.corrections}" />
                <f:render partial="Media/Rendering/Image" arguments="{file: item.images.0, data: item.data, settings: settings, variants: variants}" />
            </f:if>
        </div>
    </div>
</f:link.typolink>
</html>


Fixed version (ground truth):
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:link.typolink parameter="{item.data.link}" additionalAttributes="{draggable:'false'}">
    <div class="valign">
        <div class="carousel-text vcontainer" {f:if(condition: item.data.text_color,then: 'style="color: {item.data.text_color};"')}>
        <h{item.data.header_layout} class="carousel-header{f:if(condition: item.data.header_class, then: ' {item.data.header_class}')}{f:if(condition: item.data.header_position, then: ' text-{item.data.header_position}')}"><f:format.htmlspecialchars doubleEncode="false">{item.data.header}</f:format.htmlspecialchars></h{item.data.header_layout}>
            <f:if condition="{item.data.subheader}">
                <h{item.data.subheader_layout} class="carousel-subheader{f:if(condition: item.data.subheader_class, then: ' {item.data.subheader_class}')}{f:if(condition: item.data.header_position, then: ' text-{item.data.header_position}')}"><f:format.htmlspecialchars doubleEncode="false">{item.data.subheader}</f:format.htmlspecialchars></h{item.data.subheader_layout}>
            </f:if>
            <f:format.html>{item.data.bodytext}</f:format.html>
        </div>
        <div class="carousel-image vcontainer">
            <f:if condition="{item.images.0}">
                <f:variable name="imageConfig">{settings.responsiveimages.contentelements.{data.CType}}</f:variable>
                <f:variable name="imageConfig">{imageConfig.{item.data.item_type}}</f:variable>
                <bk2k:data.imageVariants as="variants" variants="{variants}" multiplier="{imageConfig.multiplier}" gutters="{imageConfig.gutters}" corrections="{imageConfig.corrections}" />
                <f:render partial="Media/Rendering/Image" arguments="{file: item.images.0, data: item.data, settings: settings, variants: variants}" />
            </f:if>
        </div>
    </div>
</f:link.typolink>
</html>