Skip to content

Update dependency swagger-ui to v4 [SECURITY] #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

udemyrenovateapp[bot]
Copy link

This PR contains the following updates:

Package Type Update Change
swagger-ui dependencies major ^3.13.6 -> ^4.0.0

GitHub Vulnerability Alerts

GHSA-x9p2-fxq6-2m5f

Versions of swagger-ui prior to 3.18.0 are vulnerable to Reverse Tabnapping. The package uses target='_blank' in anchor tags, allowing attackers to access window.opener for the original page. This is commonly used for phishing attacks.

Recommendation

Upgrade to version 3.18.0 or later.

CVE-2019-17495

A Cascading Style Sheets (CSS) injection vulnerability in Swagger UI before 3.23.11 allows attackers to use the Relative Path Overwrite (RPO) technique to perform CSS-based input field value exfiltration, such as exfiltration of a CSRF token value. In other words, this product intentionally allows the embedding of untrusted JSON data from remote servers, but it was not previously known that <style>@​import within the JSON data was a functional attack method.

GHSA-4f9m-pxwh-68hg

Versions of swagger-ui prior to 3.20.9 are vulnerable to Cross-Site Scripting (XSS). The package fails to sanitize URLs used in the OAuth auth flow, which may allow attackers to execute arbitrary JavaScript.

Recommendation

Upgrade to version 3.20.9 or later.

GHSA-qrmm-w75w-3wpx

SwaggerUI supports displaying remote OpenAPI definitions through the ?url parameter. This enables robust demonstration capabilities on sites like petstore.swagger.io, editor.swagger.io, and similar sites, where users often want to see what their OpenAPI definitions would look like rendered.

However, this functionality may pose a risk for users who host their own SwaggerUI instances. In particular, including remote OpenAPI definitions opens a vector for phishing attacks by abusing the trusted names/domains of self-hosted instances.

An example scenario abusing this functionality could take the following form:

  • https://example.com/api-docs hosts a version of SwaggerUI with ?url= query parameter enabled.
  • Users will trust the domain https://example.com and the contents of the OpenAPI definition.
  • A malicious actor may craft a similar OpenAPI definition and service that responds to the defined APIs at https://evildomain.
  • Users mistakenly click a phishing URL like https://example.com/api-docs?url=https://evildomain/fakeapi.yaml and enters sensitive data via the "Try-it-out" feature.

We do want to stress that this attack vector is limited to scenarios that actively trick users into divulging sensitive information. The ease of this is highly contextual and, therefore, the threat model may be different for individual users and organizations. It is not possible to perform non-interactive attacks (e.g., cross-site scripting or code injection) through this mechanism.

Resolution

We've made the decision to disable query parameters (#​4872) by default starting with SwaggerUI version 4.1.3. Please update to this version when it becomes available (ETA: 2021 December). Users will still be able to be re-enable the options at their discretion. We'll continue to enable query parameters on the Swagger demo sites.

Workaround

If you host a version of SwaggerUI and wish to mitigate this issue immediately, you are encouraged to add the following custom plugin code:

SwaggerUI({
  //  ...other configuration options,
  plugins: [function UrlParamDisablePlugin() {
    return {
      statePlugins: {
        spec: {
          wrapActions: {
            // Remove the ?url parameter from loading an external OpenAPI definition.
            updateUrl: (oriAction) => (payload) => {
              const url = new URL(window.location.href)
              if (url.searchParams.has('url')) {
                url.searchParams.delete('url')
                window.location.replace(url.toString())
              }
              return oriAction(payload)
            }
          }
        }
      }
    }
  }],
})

Future UX work

Through the exploration of this issue, it became apparent that users may not be aware to which web server the Try-it-out function will send requests. While this information is currently presented at the top of the page, understanding may improve by displaying it closer to the "Execute" button where requests are actually made. We'll be exploring these UX improvements over the coming months and welcome community input. Please create a Feature Request under the GitHub Issue tab to start a conversation with us and the community.

Reflected XSS attack

Warning in versions < 3.38.0, it is possible to combine the URL options (as mentioned above) with a vulnerability in DOMPurify (https://www.cvedetails.com/cve/CVE-2020-26870/) to create a reflected XSS vector. If your version of Swagger UI is older than 3.38.0, we suggest you upgrade or implement the workaround as mentioned above.

CVE-2018-25031

Swagger UI before 4.1.3 could allow a remote attacker to conduct spoofing attacks. By persuading a victim to open a crafted URL, an attacker could exploit this vulnerability to display remote OpenAPI definitions.


Release Notes

swagger-api/swagger-ui (swagger-ui)

v4.1.3: Swagger UI v4.1.3 Released!

Compare Source

Bug Fixes

Note: to re-enable the functionality of reading config params from URL, set new queryConfigEnabled core parameter to true. More info in documentation.

v4.1.2: Swagger UI v4.1.2 Released!

Compare Source

Bug Fixes
  • request JumpToPath component always as container (f3d3898)

v4.1.1: Swagger UI v4.1.1 Released!

Compare Source

Bug Fixes

v4.1.0: Swagger UI v4.1.0 Released!

Compare Source

Bug Fixes
Features

v4.0.1: Swagger UI v4.0.1 Released!

Compare Source

Bug Fixes
  • servers: prevent UI crash when changing Server with variables (fb7e98a), closes #​7525

v4.0.0: Swagger UI v4.0.0 Released!

Compare Source

Breaking changes
  • use React 17.x and Redux 4.x
Features
  • allow using functional components with hooks (c31cb30)
Bug Fixes
Other changes
  • consolidate production and development dependencies

More information in: https://github.com/swagger-api/swagger-ui/issues/7341
Release article: https://swagger.io/blog/news/what-s-new-in-swaggerui-v4-and-swaggereditor-v4/

v3.52.5: Swagger UI v3.52.5 Released!

Compare Source

Bug Fixes

v3.52.4: Swagger UI v3.52.4 Released!

Compare Source

Bug Fixes

v3.52.3: Swagger UI v3.52.3 Released!

Compare Source

Bug Fixes

v3.52.2: Swagger UI v3.52.2 Released!

Compare Source

Bug Fixes
  • Dockerfile: fix security issue in docker image (3c9061e), closes #​7445
  • security: fix security issue in prismjs production dep (#​7493) (2a1b710), closes #​7492
  • security: fix security issue in url-parse production dep

v3.52.1: Swagger UI v3.52.1 Released!

Compare Source

Bug Fixes

v3.52.0: Swagger UI v3.52.0 Released!

Compare Source

Features
  • js-yaml: update our main YAML parser to v4.1.0 (no esprima anymore in bundle) (3248428), closes #​6804

v3.51.2: Swagger UI v3.51.2 Released!

Compare Source

Bug Fixes
  • deps: bump swagger-client to v3.14.1 (#​7440) (8daf4e4), closes #​7436
  • minimum runtime Node.js version is now => 12.4

v3.51.1: Swagger UI v3.51.1 Released!

Compare Source

Bug Fixes

v3.51.0: Swagger UI v3.51.0 Released!

Compare Source

Features
Bug Fixes
Deprecation Warning

Swagger UI now requires Node.js v12. Node.js v10 has reached its EOL on 30-04-2021. Documentation has been updated in this PR #​7359

v3.50.0: Swagger UI v3.50.0 Released!

Compare Source

Features
Bug Fixes
Deprecation warning
  • wrapComponents: The new configuration option introduced in this version sets the default to legacy, with an opt-in setting for chain. In a future version, this configuration option will toggle to chain as default, as it is the intended fixed correct behavior. If your application expects and/or requires the legacy option, please update your application accordingly. If your application is agnostic towards the either chain or legacy, no change is needed.

v3.49.0: Swagger UI v3.49.0 Released!

Compare Source

Features
Bug Fixes

v3.48.0: Swagger UI v3.48.0 Released!

Compare Source

Bug Fixes
Features

v3.47.1: Swagger UI v3.47.1 Released!

Compare Source

[email protected] was a valid but incomplete release. This release should contain downstream release jobs.

v3.47.0: Swagger UI v3.47.0 Released!

Compare Source

Features
Bug Fixes

v3.46.0: Swagger UI v3.46.0 Released!

Compare Source

Features
Bug Fixes
Other

v3.45.1: Swagger UI v3.45.1 Released!

Compare Source

Bug Fixes

v3.45.0: Swagger UI v3.45.0 Released!

Compare Source

Features
Bug Fixes

v3.44.1: Swagger UI v3.44.1 Released!

Compare Source

Bug Fixes

v3.44.0: Swagger UI v3.44.0 Released!

Compare Source

Bug Fixes
  • info: use externalDocsUrl check to render Link (#​6997) (b7d3d1c)
  • lint: use semicolons + closing link in html (#​6951) (17093f2)
  • lint: put script tag in body in oauth2-redirect.html (#​6958)
Features

v3.43.0: Swagger UI v3.43.0 Released!

Compare Source

Features
Bug Fixes
  • support OAuth2 PKCE when using the OIDC authorization_code flow (#​6914) (5e69d3c)
  • sample-gen: enum without type should be handled by sample-gen (#​6912) (7ead9ba)
Other

swagger-cllient: version bump to 3.13.1

v3.42.0: Swagger UI v3.42.0 Released!

Compare Source

Features
Bug Fixes

v3.41.1: Swagger UI v3.41.1 Released!

Compare Source

Bug Fixes
  • swagger-ui-react: src filename extension to transpile (#​6876) (e538e26)

v3.41.0: Swagger UI v3.41.0 Released!

Compare Source

Features
  • sample-gen: yaml sample generation (#​6858) (470e2fe)
  • ux: enhance media-type switching experience in RequestBodyEditor (#​6837) (e877580)
  • config: add tryItOutEnabled configuration (#​6865) (265bdc0)
  • swagger-client: bump to v3.12.2
Bug Fixes
  • buildUrl: relative url is invalid URL (OAS3) or non-url (OAS2) (#​6864) (a5eb3dc)
  • sample-gen: case yaml parsed example is number but string schema (#​6872) (5b2ad68)
  • ux: ensure that optional security schema is rendered without padlock. (#​6839) (eddde95)
  • webpack: assets should not be treaded as esModule (#​6861) (cdfb64f)

v3.40.0: Swagger UI v3.40.0 Released!

Compare Source

Features
Bug Fixes

v3.39.0: Swagger UI v3.39.0 Released!

Compare Source

Features
  • ux: Disabled Execute button while request is in progress (#​6776) (2bf39e0)
Bug Fixes
  • sample-gen: first oneOf or anyOf should be combined with schema (#​6775) (0f541a1)
  • style: response data flows off the screen (#​6764) (85a3ec9)
  • examples: Request Body examples should respect media-type (#​6739) (68e9b1b)

v3.38.0: Swagger UI v3.38.0 Released!

Compare Source

Features
Bug Fixes

v3.37.2: Swagger UI v3.37.2 Released!

Compare Source

v3.37.1: Swagger UI v3.37.1 Released!

Compare Source

Warning

This is a failed release which is identical to v3.37.0. Please install v3.37.2 instead.

v3.37.0: Swagger UI v3.37.0 Released!

Compare Source

Features
Bug Fixes

v3.36.2: Swagger UI v3.36.2 Released!

Compare Source

Bug Fixes

v3.36.1: Swagger UI v3.36.1 Released!

Compare Source

Bug Fixes

v3.36.0: Swagger UI v3.36.0 Released!

Compare Source

Features
Bug Fixes

v3.35.2: Swagger UI v3.35.2 Released!

Compare Source

Bug Fixes

v3.35.1: Swagger UI v3.35.1 Released!

Compare Source

Bug Fixes

v3.35.0: Swagger UI v3.35.0 Released!

Compare Source

Bug Fixes
Features
  • curl: configuration setting to pass additional options to curl command for "Try it out" (#​6288) (cbe99c8)
  • swagger-ui-react: add deeplinking as prop (#​6424) (6b12f15)

v3.34.0: Swagger UI v3.34.0 Released!

Compare Source

Features
Refactor
  • build: increase maxEntrypointSize for core-js@3 (#​6419)
  • csp: Update how the JavaScript run function is invoked in oauth2-redirect.html (#​6393)

v3.33.0: Swagger UI v3.33.0 Released!

Compare Source

Bug Fixes

Configuration

📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


Branch Conflicts?

♻ To rebase this PR, add the label Run Renovate to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants