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: Add proper escaping for theme actions in themes.php #7790

Conversation

himanshupathak95
Copy link

@himanshupathak95 himanshupathak95 commented Nov 13, 2024

This PR adds proper escaping for theme names, URLs, and attributes in the themes.php file to prevent potential vulnerabilities.

Changes Made:

  • Added esc_html() escaping for theme name outputs
  • Added esc_url() escaping for theme action URLs:
    • Customize action URLs
    • Activate action URLs

Adds proper escaping for theme name outputs and URLs in the themes.php file:
- Add esc_html() for theme name output
- Add esc_url() for customize and activate action URLs
- Add esc_attr() for aria labels
- Maintain existing translations and template functionality

This prevents potential XSS vulnerabilities in theme management interface.
Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props abcd95.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@himanshupathak95 himanshupathak95 deleted the fix/themes-php-escaping branch November 13, 2024 12:38
@desrosj
Copy link
Contributor

desrosj commented Nov 13, 2024

Hi @himanshupathak95,

Did you mean to close this out?

@himanshupathak95
Copy link
Author

himanshupathak95 commented Nov 13, 2024

Hey @desrosj, Thanks for asking!

I did mean to close this. The moment I created this PR, another PR for the same issue was created and merged ( since the issue addressed security concerns and timing was important ). Now that the issue stands resolved, I had to close the PR.

@desrosj
Copy link
Contributor

desrosj commented Nov 13, 2024

Ah ha! Thanks, I see that duplicate ticket now. Appreciate the attempt to fix this.

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