Seems like the drag template is vulnerable for XSS attacks
See original GitHub issueWe create a drag item template which is based on user’s input (e.g. item name). Seems that this behaviour is vulnerable for XSS attack, in case the user put a script tag in the item name. We can sanitize user’s input, but as developers usually rely on Angular automatic sanitization process, we think that the data-jqyoui-options directive should take care of this as well, if possible.
For example, try to define this draggable item:
<div
data-drag="true"
jqyoui-draggable
data-jqyoui-options="{helper: getItemDragTemplate(), appendTo: 'body'}">
Where the getItemDragTemlpate is:
<div>item.name</div>
Where item.name is some user malicious input, for example:
<script>alert('hello')</script>
Dragging such an item will cause the script to run.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Cross-site Scripting (XSS) in microweber/microweber | Snyk
microweber/microweber is a new generation CMS with drag and drop. Affected versions of this package are vulnerable to Cross-site Scripting ...
Read more >Cross-site Scripting (XSS): What Is It and How to Fix it?
The problem is that not all WordPress plugins and themes are 100% secure and many of them do, in fact, have XSS vulnerabilities....
Read more >Cross Site Scripting (XSS) Attack Tutorial with Examples ...
Cross Site Scripting (XSS) is a commonly known vulnerable attack for every advanced tester. In this XSS tutorial learn XSS attack with XSS ......
Read more >XSS 101 - Brute XSS
XSS attacks abuse the dynamic way websites interact with their clients, the browsers. It makes possible, for an attacker, to control the ...
Read more >In Login page of web application, I have allowed drag and ...
An XSS attack is performed by injecting malicious code to be displayed to another user. To use a standard login form for an...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m not sure I follow… because jqueryUI draggable, which you use, allows to change the markup. This is done by providing a function through an “helper” property: https://api.jqueryui.com/draggable/#option-helper
All I’m saying is that, if helper is a function - it must return a DOM element, which means it should be sanitized (or at least optional sanitized…).
@benbracha I really appreciate your efforts in providing the solution. However, not everybody allows to modify the markup before dragging/dropping unlike your requirement. That’s why I did not want to add the fix in angular-dragdrop. I hope it clarifies the issue.