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

Sanitize headline #1550

Merged
merged 3 commits into from May 2, 2022
Merged

Sanitize headline #1550

merged 3 commits into from May 2, 2022

Conversation

gseidel
Copy link
Member

@gseidel gseidel commented May 2, 2022

Q A
Bug fix? yes
Backport 0.9, 0.10
Tickets #1543
License MIT

According to #1543, there is a security issue where xss code can be executed in frontend. Enhavo already provide a twig filter html_sanitize to prevent xss injections, but in this case the filter is not applied to the output of the headline filter. The headline filter is marked as html safe, which is not true. To unmark it as html safe will cause bc breaks because the output will be encoded html. So we apply the sanitize routine to the headline filter to satisfy the html safe mark.

Further outputs where checked as well and the raw filter was replaced with html_sanitize where html output from the user is expected.

@gseidel gseidel merged commit 33c68ba into master May 2, 2022
@gseidel gseidel deleted the sanitize-headline branch May 2, 2022 21:19
mergify bot pushed a commit that referenced this pull request May 2, 2022
| Q             | A
| ------------- | ---
| Bug fix?      | yes
| Backport      | 0.9, 0.10
| Tickets       | #1543
| License       | MIT

According to #1543, there is a security issue where xss code can be executed in frontend. Enhavo already provide a twig filter `html_sanitize` to prevent xss injections, but in this case the filter is not applied to the output of the `headline` filter.  The `headline` filter is marked as html safe, which is not true. To unmark it as html safe will cause bc breaks because the output will be encoded html. So we apply the sanitize routine to the headline filter to satisfy the html safe mark.

Further outputs where checked as well and the `raw` filter was replaced with `html_sanitize` where html output from the user is expected.

(cherry picked from commit 33c68ba)
mergify bot pushed a commit that referenced this pull request May 2, 2022
| Q             | A
| ------------- | ---
| Bug fix?      | yes
| Backport      | 0.9, 0.10
| Tickets       | #1543
| License       | MIT

According to #1543, there is a security issue where xss code can be executed in frontend. Enhavo already provide a twig filter `html_sanitize` to prevent xss injections, but in this case the filter is not applied to the output of the `headline` filter.  The `headline` filter is marked as html safe, which is not true. To unmark it as html safe will cause bc breaks because the output will be encoded html. So we apply the sanitize routine to the headline filter to satisfy the html safe mark.

Further outputs where checked as well and the `raw` filter was replaced with `html_sanitize` where html output from the user is expected.

(cherry picked from commit 33c68ba)
@gseidel gseidel mentioned this pull request May 2, 2022
gseidel added a commit that referenced this pull request May 2, 2022
| Q             | A
| ------------- | ---
| Bug fix?      | yes
| Backport      | 0.9, 0.10
| Tickets       | #1543
| License       | MIT

According to #1543, there is a security issue where xss code can be executed in frontend. Enhavo already provide a twig filter `html_sanitize` to prevent xss injections, but in this case the filter is not applied to the output of the `headline` filter.  The `headline` filter is marked as html safe, which is not true. To unmark it as html safe will cause bc breaks because the output will be encoded html. So we apply the sanitize routine to the headline filter to satisfy the html safe mark.

Further outputs where checked as well and the `raw` filter was replaced with `html_sanitize` where html output from the user is expected.

(cherry picked from commit 33c68ba)

Co-authored-by: Gerhard Seidel <gseidel.message@googlemail.com>
gseidel added a commit that referenced this pull request May 2, 2022
| Q             | A
| ------------- | ---
| Bug fix?      | yes
| Backport      | 0.9, 0.10
| Tickets       | #1543
| License       | MIT

According to #1543, there is a security issue where xss code can be executed in frontend. Enhavo already provide a twig filter `html_sanitize` to prevent xss injections, but in this case the filter is not applied to the output of the `headline` filter.  The `headline` filter is marked as html safe, which is not true. To unmark it as html safe will cause bc breaks because the output will be encoded html. So we apply the sanitize routine to the headline filter to satisfy the html safe mark.

Further outputs where checked as well and the `raw` filter was replaced with `html_sanitize` where html output from the user is expected.

(cherry picked from commit 33c68ba)

Co-authored-by: Gerhard Seidel <gseidel.message@googlemail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant