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

Updates fix for stored cross-site scripting from 0.90.0, now applied to all tags. #526

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

picandocodigo
Copy link
Owner

Bumps version to 0.90.2

@klemens-st Another way to trigger an XSS with script was reported for different fields. As we've talked before, the vulnerabilites are present when WordPress has already been compromised, since the malintentioned user would need permision to publish content on the system to trigger them. But if it helps keeping a site safer, then why not... 🤷

Ideally I think it's up to the users to use or not use <script> with the plugin, so eventually we could make this optional (warning the users they should really know what they're doing if they want to allow it). But I think it's also ok not to support the script tag.

I think this is the best place in the code to remove support for <script> since it's the function wrap uses, and the times to_html is used in other places seems to be safe. Let me know what you think.

Copy link
Collaborator

@klemens-st klemens-st left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is not a major threat as discussed before.

I honestly think nobody uses LCP with script as tag so we can remove it. If anybody asks to put it back we can add the option you mentioned and make it available for users above Contributor, because all these supposed security threats arise from the fact Contributors can use shortcodes but cannot use <script>.

Comment on lines +32 to +40
# Security vulnerability fix for Stored Cross-Site Scripting
# If a field stores some malicious JavaScript, it could be displayed with the 'script' tag, so
# that tag needs to be excluded.
# e.g. If a post has this excerpt: alert(/XSS/) another post could use:
# [catlist excerpt_tag='script' excerpt=yes]
# and the XSS would be triggered.
if ( $tag == 'script' ) {
$tag = null;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's a matter of preference (or style) which method this should belong to and it's perfectly fine to have it here.

@picandocodigo
Copy link
Owner Author

Thank you @klemens-st!

@picandocodigo picandocodigo merged commit 9dae245 into master Dec 16, 2024
2 checks passed
@picandocodigo picandocodigo deleted the xss_2 branch December 16, 2024 19:57
@klemens-st klemens-st restored the xss_2 branch December 18, 2024 09:48
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

Successfully merging this pull request may close these issues.

2 participants