You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
When using the VirtualSelect library with user-controlled options values, certain JavaScript event handlers embedded within the label or value fields are executed, potentially leading to a Cross-Site Scripting (XSS) vulnerability. This issue occurs even with the enableSecureText option enabled, suggesting that it does not fully sanitize or escape inputs with JavaScript embedded.
Observe that clicking on the injected option label triggers an alert dialog due to the embedded onclick event.
Expected Behavior:
The enableSecureText option should escape or sanitize any potentially harmful JavaScript, ensuring that user-provided content in label and value fields cannot trigger XSS.
Actual Behavior:
JavaScript code embedded within value fields is executed, leading to a potential XSS vulnerability.
Environment:
VirtualSelect version: 1.0.46
Browser: Chrome, Safari, Firefox
Operating System: Windows, MacOS, Android, iOS
The text was updated successfully, but these errors were encountered:
izambasiron
added a commit
to izambasiron/virtual-select
that referenced
this issue
Nov 7, 2024
- Fixed typo on `enableSecureText` description withing the documentation
- Updated some dev dependencies from the project
- Fixed issue #365 associated with a XSS vulnerability (`enableSecureText` most the set to true for this to be applied)
- Fixed typo on `enableSecureText` description withing the documentation
- Updated some dev dependencies from the project
- Fixed issue #365 associated with a XSS vulnerability (`enableSecureText` most the set to true for this to be applied)
Description:
When using the
VirtualSelect
library with user-controlledoptions
values, certain JavaScript event handlers embedded within thelabel
orvalue
fields are executed, potentially leading to a Cross-Site Scripting (XSS) vulnerability. This issue occurs even with theenableSecureText
option enabled, suggesting that it does not fully sanitize or escape inputs with JavaScript embedded.Codepen demo
Steps to Reproduce:
Initialize
VirtualSelect
with an option containing a JavaScriptonclick
event in thelabel
andvalue
fields.Load the page containing this code.
Observe that clicking on the injected option label triggers an
alert
dialog due to the embeddedonclick
event.Expected Behavior:
The
enableSecureText
option should escape or sanitize any potentially harmful JavaScript, ensuring that user-provided content inlabel
andvalue
fields cannot trigger XSS.Actual Behavior:
JavaScript code embedded within
value
fields is executed, leading to a potential XSS vulnerability.Environment:
The text was updated successfully, but these errors were encountered: