Skip to content
XSS Disclosed report Intermediate

Swagger UI Injection via Config URL - `███`

A Swagger UI endpoint accepted a user-controlled configUrl parameter that loaded JSON configuration from an external source. An attacker could use this to inject malicious configuration and potentially run scripts in the context of the Swagger UI page.

0xzyo Follow

Originally disclosed on HackerOne

  • Triaged in 3 days
  • Fixed in 32 days
  • Disclosed after 8 months

Summary: A Swagger UI injection vulnerability has been identified on the following endpoint: ███ The issue allows an attacker to inject custom JSON configuration (via the configUrl parameter) into the Swagger UI. This may lead to cross-site scripting (XSS) or manipulation of the Swagger UI behavior, potentially exposing sensitive information or facilitating further attacks.

███████

Impact

This vulnerability could be exploited to perform XSS attacks or inject malicious scripts via the Swagger UI configuration.

System Host(s)

███████

Affected Product(s) and Version(s)

Swagger UI

CVE Numbers

Steps to Reproduce

  1. Visit the URL: █████████
  2. Observe that the Swagger UI configuration is injected from an external JSON source.

Suggested Mitigation/Remediation Actions

Ensure proper sanitization and validation of all user-controlled inputs, particularly the configUrl parameter, to prevent malicious injections.

The original report as published on HackerOne, by 0xzyo. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the application passed a user-supplied configUrl to Swagger UI without validating or restricting where the configuration could be loaded from.

Impact

This could be exploited to perform XSS attacks or inject malicious scripts via the Swagger UI configuration.

What the attacker needed

Access to the affected Swagger UI endpoint

The fix

The configUrl parameter should be validated and restricted so that only trusted configuration sources are accepted.

How it was found

  1. Visit the affected Swagger UI URL.
  2. Observe that the Swagger UI configuration is loaded from an external JSON source.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

Swagger UI is a page that documents and lets you try out an API. It can be told to load its settings from another web address, and here that address was not checked. Someone could point it at their own settings file, which might make the page run their code or behave in a misleading way.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More by 0xzyo

View all

2 more disclosed reports, best first.

More from U.S. Dept Of Defense

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.