Skip to content
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

[Question/Feature] make Sanitizer aware of currently processes tags and have a list of allowed attributes per element #105

Open
medarob opened this issue Jun 18, 2024 · 0 comments

Comments

@medarob
Copy link

medarob commented Jun 18, 2024

It seems that the Sanitizer checks/allows all attributes for every tag, no matter if the attribute will be used for this tag or not.

This is why the to attribute is not allowed because it can be a security issue for certain tags.

However, the to attribute seems to be not problematic for the <animateTransform> tag, so it should be allowed in this context.
#85 (comment)

Using TYPO3, the approach described in the comment seems to be not possible (so I was told) because of:
https://github.com/TYPO3/typo3/blob/f086b0dff39786f3f2825c7f3a7275f88726020a/typo3/sysext/core/Classes/Resource/Security/SvgSanitizer.php#L50-L52

So, maybe it's possible to add a proper structured parsing and make the Sanitizer aware of the currently processed element and have a list of allowed attributes per element?

For now I patched it in the global list which allows the to attribute for all tags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant