HexBrain

Browse / CVEs / CVE-2019-10405

CVE-2019-10405· jenkins / jenkins· CWE-79

Jenkins <=2.196 - Cookie Exposure

mediumseverity
5.4CVSS score
65.3%likelihood of exploitation, next 30 days
99%of all CVEs are less likely
Readycheck to confirm it

Jenkins through 2.196, LTS 2.176.3 and earlier prints the value of the cookie on the /whoAmI/ URL despite it being marked HttpOnly, thus making it possible to steal cookie-based authentication credentials if the URL is exposed or accessed via another cross-site scripting issue.

Impact

The exposure of cookies can lead to session hijacking, unauthorized access, and potential data breaches.

Fix

Upgrade Jenkins to a version higher than 2.196 to mitigate the vulnerability.

How to confirm it

Send: GET {{BaseURL}}/whoAmI/
Positive when: contains in header "text/html" and "x-jenkins" AND contains in body_2 "Cookie" and "JSESSIONID" AND status 200

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

The full check
id: CVE-2019-10405

info:
  name: Jenkins <=2.196 - Cookie Exposure
  author: c-sh0
  severity: medium
  description: Jenkins through 2.196, LTS 2.176.3 and earlier prints the value of the cookie on the /whoAmI/ URL despite it being marked HttpOnly, thus making it possible to steal cookie-based authentication credentials if the URL is exposed or accessed via another cross-site scripting issue.
  impact: |
    The exposure of cookies can lead to session hijacking, unauthorized access, and potential data breaches.
  remediation: |
    Upgrade Jenkins to a version higher than 2.196 to mitigate the vulnerability.
  reference:
    - https://jenkins.io/security/advisory/2019-09-25/#SECURITY-1505
    - http://www.openwall.com/lists/oss-security/2019/09/25/3
    - https://nvd.nist.gov/vuln/detail/CVE-2019-10405
    - https://github.com/ARPSyndicate/kenzer-templates
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N
    cvss-score: 5.4
    cve-id: CVE-2019-10405
    cwe-id: CWE-79
    epss-score: 0.6529
    epss-percentile: 0.99263
    cpe: cpe:2.3:a:jenkins:jenkins:*:*:*:*:lts:*:*:*
  metadata:
    max-request: 2
    vendor: jenkins
    product: jenkins
    shodan-query:
      - http.favicon.hash:81586312
      - cpe:"cpe:2.3:a:jenkins:jenkins"
      - product:"jenkins"
    fofa-query: icon_hash=81586312
  tags: cve,cve2019,jenkins,vuln

http:
  - raw:
      - |
        GET {{BaseURL}}/whoAmI/ HTTP/1.1
        Host: {{Hostname}}
      - |
        GET {{BaseURL}}/whoAmI/ HTTP/1.1
        Host: {{Hostname}}

    matchers-condition: and
    matchers:
      - type: word
        part: header
        words:
          - 'text/html'
          - 'x-jenkins'
        case-insensitive: true
        condition: and

      - type: word
        part: body_2
        words:
          - 'Cookie'
          - 'JSESSIONID'
        condition: and

      - type: status
        status:
          - 200

    extractors:
      - type: kval
        kval:
          - x_jenkins

References

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