-
Notifications
You must be signed in to change notification settings - Fork 120
Security-fix: enhance security by safely parsing HTML #2259
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
Conversation
… in Magnific Popup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enhances security in the Magnific Popup library by implementing safer HTML parsing techniques to prevent potential XSS vulnerabilities. The changes focus on preventing malicious HTML execution by using explicit parsing methods instead of relying on jQuery's implicit HTML interpretation.
- Replaces jQuery's implicit HTML parsing with explicit
$.parseHTML()for close button markup - Switches from jQuery selector/HTML parsing to native
document.querySelector()for the prependTo option to ensure strings are treated strictly as CSS selectors
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ors and providing a fallback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (typeof mfp.st.prependTo === 'string') { | ||
| appendToEl = $(document.body).find(mfp.st.prependTo); | ||
| if (typeof mfp.st.prependTo === 'string') { | ||
| // FIX: Use document.querySelector to ensure the string is treated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you remove the FIX:? Some of the tools think it's a todo directive.
|
Unable to PHPCS or SVG scan one or more files due to error running PHPCS/SVG scanner:
The error may be temporary. If the error persists, please contact a human (commit-ID: 67e3d1e). |
mi5t4n
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.