id: CVE-2026-40878

info:
  name: Mailcow < 2026-03b - Href Link Injection
  author: ritikchaddha
  severity: low
  description: |
    mailcow < 2026-03b reflects raw REQUEST_URI into JavaScript and href links on the login page, allowing attackers to inject parameters that break JS logic and enable phishing.
  impact: |
    Unauthenticated parameter injection into JavaScript and href attributes on the login page. Enables phishing, open-redirect chaining, and JS logic corruption (DoS of FIDO2/WebAuthn and CSRF handlers) via backslash injection.
  remediation: |
    Upgrade to mailcow 2026-03b or later.
  reference:
    - https://github.com/mailcow/mailcow-dockerized/security/advisories/GHSA-xv9r-j862-5hqf
    - https://github.com/mailcow/mailcow-dockerized
    - https://nvd.nist.gov/vuln/detail/CVE-2026-40878
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:L
    cvss-score: 3.1
    cve-id: CVE-2026-40878
    epss-score: 0.00805
    epss-percentile: 0.53224
  metadata:
    verified: true
    max-request: 2
    vendor: mailcow
    product: mailcow-dockerized
    shodan-query: http.favicon.hash:2146763496
    fofa-query: title="mailcow"
  tags: cve,cve2026,mailcow,link-injection

http:
  - method: GET
    path:
      - "{{BaseURL}}/?session_expired=true&redirect=http://evil.com"

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - "function setLang"
          - "$.post( '/?session_expired=true&amp;redirect=http://evil.com"
        condition: and

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