Repository navigation
fix(SP-23180): prevent DOM XSS via innerHTML on search page title - #1046
Draft
salkhwlani wants to merge 1 commit into
Draft
salkhwlani wants to merge 1 commit into
salkhwlani wants to merge 1 commit into
Conversation
intent(theme-raed): SAL-1340 - Intigriti SALLA-38ORF9DB reported that the raw q search parameter is reflected into #page-main-title via innerHTML on the salla-products-list::products.fetched event, allowing HTML/JS injection. Switch to textContent since the title is always plain text.
Contributor
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | ✅ 0 (≤ 2 duplication) |
AI Reviewer: run a review on demand. To trigger the first review automatically, go to your organization or repository integration settings. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
What is the current behaviour? (You can also link to an open issue here)
qsearch query parameter is reflected into#page-main-titleviainnerHTMLinsrc/assets/js/products.js, on thesalla-products-list::products.fetchedevent. A craftedqvalue (e.g./search?q=<span>...</span>) is rendered as live HTML, allowing DOM XSS on any storefront using this theme. Reported via Intigriti SALLA-38ORF9DB, confirmed on demostore.salla.sa.What is the new behaviour? (You can also link to the ticket here)
textContentinstead ofinnerHTML, so the rawqparameter can no longer be rendered as HTML/JS. The title was never intended to carry markup.Does this PR introduce a breaking change?
Screenshots (If appropriate)
Closes SAL-1340