id: mismatched-ssl-certificate

info:
  name: Mismatched SSL Certificate
  author: pdteam
  severity: info
  description: |
    Mismatched certificates occur when there is inconsistency between the common name to which the certificate was issued and the domain name in the URL. This issue impacts the trust value of the affected website.
  reference:
    - https://www.invicti.com/web-vulnerability-scanner/vulnerabilities/ssl-certificate-name-hostname-mismatch/
  metadata:
    max-request: 1
  tags: ssl,tls,mismatched,vuln
ssl:
  - address: "{{Host}}:{{Port}}"
    matchers:
      - type: dsl
        dsl:
          - "mismatched == true"
          - "ip != host"
          - "!contains(host, 'enterpriseregistration.') && !contains(host, 'enterpriseenrollment.')"
        condition: and

    extractors:
      - type: dsl
        dsl:
          - '"CN: " + subject_cn'
# digest: 490a0046304402200ca29bedf15147ffdf4c9f408ed697613ed52c71b2aa3b5af3cfce9df408da55022048054442010b28e1b1648fa73731397cde1699b34f58df0e8f1e237dbe2bbdc0:922c64590222798bb761d5b6d8e72950