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

Fix: sanitize shortcode atts #7379

Merged
merged 1 commit into from
May 3, 2024

Conversation

alaca
Copy link
Member

@alaca alaca commented May 2, 2024

Description

This PR is an addition to #7375
In the previous PR, sanitization is added to input args only, but that won't be enough if the malicious code is already saved in the database. To fix this, sanitization of the data before output is also added.

Affects

give_form shortcode

Testing Instructions

Install and activate Give
Create a form using "Legacy Form" template
Create a new Post and add a shortcode
[give_form id="13721" display_style='abcdef"onmouseover=alert(123) b=']
Replace id with form id
Open the post and move the mouse on the button

Pre-review Checklist

  • Relevant @unreleased tags included in DocBlocks
  • Self Review of code and UX completed

@alaca alaca requested a review from kjohnson May 2, 2024 06:26
Copy link
Member

@rickalday rickalday left a comment

Choose a reason for hiding this comment

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

Passed manual QA tests

Copy link
Member

@kjohnson kjohnson left a comment

Choose a reason for hiding this comment

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

LGTM

@alaca alaca merged commit b27becd into develop May 3, 2024
20 checks passed
@alaca alaca deleted the fix/sanitize-give-shortcode-atts-GIVE-646 branch May 3, 2024 07:29
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.

3 participants