From c0698bb21569854a1a4c62f7b01edb8f69fc8fa1 Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Fri, 12 May 2017 12:38:05 +0300 Subject: [PATCH] fix: prevent possible xss using `untrusted-spec` option --- README.md | 1 + demo/index-gh.html | 2 +- demo/index.html | 2 +- lib/services/options.service.ts | 3 +++ lib/utils/pipes.ts | 12 +++++++----- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 068a26be..eb6f15b6 100644 --- a/README.md +++ b/README.md @@ -131,6 +131,7 @@ ReDoc makes use of the following [vendor extensions](http://swagger.io/specifica ### `` tag attributes * `spec-url` - relative or absolute url to your spec file; +* `untrusted-spec` - if set, the spec is considered untrusted and all HTML/markdown is sanitized to prevent XSS. **Disabled by default** for performance reasons. **Enable this option if you work with untrusted user data!** * `scroll-y-offset` - If set, specifies a vertical scroll-offset. This is often useful when there are fixed positioned elements at the top of the page, such as navbars, headers etc; `scroll-y-offset` can be specified in various ways: * **number**: A fixed number of pixels to be used as offset; diff --git a/demo/index-gh.html b/demo/index-gh.html index 17724a03..5835dfc9 100644 --- a/demo/index-gh.html +++ b/demo/index-gh.html @@ -22,7 +22,7 @@ frameborder="0" scrolling="0" width="130px" height="30px"> - + diff --git a/demo/index.html b/demo/index.html index ee983bf4..8ef1e02a 100644 --- a/demo/index.html +++ b/demo/index.html @@ -22,7 +22,7 @@ frameborder="0" scrolling="0" width="130px" height="30px"> - +