-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iFrame is escaped in output and not working anymore #70
Comments
Currently there is no generic solution (yet) in
TypoScript configuration as shown above does not have any impact on
Without explicitly defining allowed attributes for all(!) tags, the shown TypoScript configuration allows cross-site scripting - and that's exactly the reason <iframe src="javascript:alert('iframe-src')"></iframe>
<object data="null" type="text/invalid" onerror="alert('object-err')"></object>
<embed src="null" type="text/invalid" onload="alert('embed-err')" height="100" widht="100"> |
Some additional research, this is for instance how mailtrap.io is embedding arbitrary mails in an <iframe src="..." title="Message view" class="i6jjn6"
sandbox="allow-popups-to-escape-sandbox allow-forms allow-pointer-lock allow-popups allow-presentation allow-orientation-lock allow-modals allow-same-origin"><p>Your browser does not support iframes.</p></iframe> |
I've added a section on https://github.com/TYPO3/html-sanitizer/blob/main/tests/ScenarioTest.php#L162-L212 $behavior = (new Behavior())
->withFlags(Behavior::ENCODE_INVALID_TAG + Behavior::REMOVE_UNEXPECTED_CHILDREN)
->withName('scenario-test')
->withTags(
(new Behavior\Tag('iframe'))->addAttrs(
(new Behavior\Attr('id')),
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-allow
(new Behavior\Attr('allow'))->withValues(
new Behavior\MultiTokenAttrValue(' ', 'fullscreen')
),
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-sandbox
(new Behavior\Attr('sandbox', Behavior\Attr::MANDATORY))->withValues(
new Behavior\EmptyAttrValue(),
new Behavior\MultiTokenAttrValue(
' ',
'allow-downloads',
'allow-modals',
'allow-orientation-lock',
'allow-pointer-lock',
'allow-popups',
'allow-scripts'
)
),
(new Behavior\Attr('src'))->withValues(
...(new UriAttrValueBuilder())->allowSchemes('http', 'https')->getValues()
)
)
); |
I've extracted this to a stand-alone preset in PR #93 |
Since some versions there is a problem that iFrames are escaped in the output and the iframe is not visible. Before 10.4.18 i think it was working fine. Not the problem is that the youtube plugin for the RTE isn't working anymore.
Version is 10.4.21 (Composer latest version)
So i have checked not a lot of tutorials and tested now over 2 hours all solutions.
In the Site TS-Config i have tested a low of things.
But nothing is working anymore. Is there a solution or a fix to solve the Problem? Do i miss something?
The text was updated successfully, but these errors were encountered: