CVE-2018-1000861 in jenkins
LogPulse has a published detection rule for this CVE: it raises a notable when someone tries to exploit it.
What the vulnerability is
A code execution vulnerability exists in the Stapler web framework used by Jenkins 2.153 and earlier, LTS 2.138.3 and earlier in 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.
Affected software: jenkins, redhat openshift container platform
Scores
- CVSS: 9.8 (critical)
- EPSS: 98.33% chance of exploitation in the next 30 days
- CISA KEV: Known exploited, listed 2022-02-10
- Published: 2018-12-10
What LogPulse has for it
- Detection rule: Yes, published
- Agent check (vulnerable version): Yes, published
- Mitigation: Yes, see below
How to mitigate it
Upgrade Jenkins core and Script Security plugins (Stapler and sandbox bypass)
Patch or upgrade. Updating Jenkins core past 2.153 / LTS 2.138.3 closes the Stapler routes that reach the script check endpoints without login, and updating Script Security past 1.53 and Pipeline: Groovy past 2.63 applies the sandbox during parsing, compilation and instantiation, which stops the Groovy sandbox bypass RCE.
Applies to: Jenkins core up to 2.153 and LTS up to 2.138.3; Script Security Plugin up to and including 1.53; Pipeline: Groovy Plugin up to and including 2.63; Matrix Project Plugin up to and including 1.13
- In Jenkins open Manage Jenkins > Manage Plugins > Installed (or Manage Jenkins > System Information) and note the versions of Jenkins core, Script Security, Pipeline: Groovy (workflow-cps) and Matrix Project.
- Back up JENKINS_HOME (at least config.xml, jobs/ and plugins/) before upgrading.
- Upgrade Jenkins core to 2.154 or later (weekly) or LTS 2.138.4 or later; preferably the current LTS release.
- In Manage Plugins > Updates, update Script Security to a version later than 1.53, Pipeline: Groovy to a version later than 2.63 and Matrix Project to a version later than 1.13 (the 2019-03-06 advisory fixes); preferably install the current releases of all plugins.
- Restart Jenkins (Manage Jenkins > Restart safely) and confirm the new versions under Installed plugins.
- Until you can upgrade: do not expose Jenkins to the internet, disable anonymous read access (Manage Jenkins > Configure Global Security, Authorization: do not grant Overall/Read to Anonymous) and block requests whose path contains descriptorByName and checkScript at the reverse proxy.
- Review the Jenkins controller for unknown jobs, users, plugins or files created around the time of any descriptorByName/checkScript requests in the proxy log.
Sources:
Source data: NIST NVD, CISA KEV and FIRST EPSS. LogPulse processes new CVEs every hour.
We build every detection with great care, but no two environments are the same. Log sources, parsing and configuration differ, so test a detection in your own environment before you rely on it.