← Vulnerability feed

Vulnerability record · CVE-2021-41282 · published 1 March 2022

CVE-2021-41282: pfSense diag_routes.php sed injection allows arbitrary file write

Pfsense · Pfsense

diag_routes.php in pfSense 2.5.2 passes netstat output through sed without preventing sed-specific code injection, even though escapeshellarg is used on arguments. An authenticated user who is only meant to view route data can inject sed commands and write an arbitrary file to an arbitrary location. This matters because it turns a low-privilege read-only feature into a file-write primitive on the firewall.

8.8 CVSS 3.1 High EPSS 87% · top 0.3% CWE-74 · Injection
8.8CVSS 3.1 base score, v2 9.0
87%EPSS exploitation probability, 30 days
NoNot in CISA KEV
1Affected product versions listed by NVD
8References, 4 tagged exploit
17 Jun 2026Last modified by NVD

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 (i.e., 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.

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Automated analysis

Generated by VULONE's analysis model from the NVD record, CISA KEV and EPSS data on 18 September 2026. Confidence: high.

high priorityCVSS 8.8 with high confidentiality, integrity and availability impact, public exploit references, and a very high EPSS score, though it requires authenticated access and is not in KEV.

What it is

diag_routes.php in pfSense 2.5.2 passes netstat output through sed without preventing sed-specific code injection, even though escapeshellarg is used on arguments. An authenticated user who is only meant to view route data can inject sed commands and write an arbitrary file to an arbitrary location. This matters because it turns a low-privilege read-only feature into a file-write primitive on the firewall.

Impact

An attacker gains the ability to write arbitrary files anywhere on the pfSense host, which can be leveraged to achieve shell upload and remote command execution. This compromises the confidentiality, integrity and availability of the firewall.

Attack surface

Reached over the network through the pfSense web interface at diag_routes.php; the CVSS vector shows PR:L, so a valid authenticated session is required, and UI:N means no user interaction beyond the attacker's own requests.

Exploitation

CISA KEV does not list it, but EPSS is very high (0.87113, 99.7th percentile) and multiple references are tagged Exploit, including a Packet Storm shell upload and a Shielder advisory, indicating public exploit code exists.

What to do

  • Upgrade pfSense to 2.6.0 or the 22-01 release, which the vendor release notes identify as containing the fix.
  • If immediate upgrade is not possible, restrict access to diag_routes.php and the web GUI to trusted administrative networks only.
  • Audit and reduce the number of accounts with GUI access, and enforce least privilege so low-privilege users cannot reach diagnostic pages.
  • Monitor the filesystem for unexpected new or modified files, especially in web-accessible directories, and remove any uploaded shells.
  • Review firewall and web logs for unusual requests to diag_routes.php from authenticated sessions.

Detection

  • Hunt web server logs for requests to diag_routes.php with unusual or sed-like parameters.
  • Monitor for new files appearing in web-accessible or system directories on pfSense hosts.
  • Alert on unexpected child processes spawned by the web GUI, particularly sed or netstat invocations with unusual arguments.
  • Use file integrity monitoring on pfSense configuration and web directories to catch unauthorized writes.

This assessment is produced automatically and is not human-reviewed. Verify against the vendor advisory before acting on it.

Affected products

1 vulnerable configurations from NVD's CPE data, grouped by vendor and product.

References

Track CVE-2021-41282 inside VULONE

Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.

Start free Open in platform

Related vulnerabilities

Same products first, then exploited flaws of the same weakness class.

9.9CVE-2025-69691Pfsense improper access control vulnerabilityNetgate pfSense CE 2.8.0 allows code execution in the XMLRPC API via pfsense.exec_php. NOTE: the Supplier disputes this because the API call is only …EPSS 0.68%9.8CVE-2023-29974Pfsense weak password requirements vulnerabilityAn issue discovered in Pfsense CE version 2.6.0 allows attackers to compromise user accounts via weak password requirements.EPSS 1.8%9.8CVE-2023-27100Netgate pfsense plus improper restriction of authentication attempts vulnerabilityImproper restriction of excessive authentication attempts in the SSHGuard component of Netgate pfSense Plus software v22.05.1 and pfSense CE software…EPSS 9.8%9.1CVE-2025-69690Pfsense deserialization of untrusted data vulnerabilityNetgate pfSense CE 2.7.2 allows code execution by using the module installer with a backup file with a serialized PHP object containing the post_rebo…EPSS 0.81%8.8CVE-2016-10709Pfsense os command injection vulnerabilitypfSense before 2.3 allows remote authenticated users to execute arbitrary OS commands via a '|' character in the status_rrd_graph_img.php graph param…EPSS 34%7.5CVE-2020-19678Oisf suricata path traversal vulnerabilityDirectory Traversal vulnerability found in Pfsense v.2.1.3 and Pfsense Suricata v.1.4.6 pkg v.1.0.1 allows a remote attacker to obtain sensitive info…EPSS 3.5%7.5CVE-2011-4197Pfsense permissions and access controls vulnerabilityetc/inc/certs.inc in the PKI implementation in pfSense before 2.0.1 creates each X.509 certificate with a true value for the CA basic constraint, whi…EPSS 1.9%7.2CVE-2023-29975Pfsense improper authentication vulnerabilityAn issue discovered in Pfsense CE version 2.6.0 allows attackers to change the password of any user without verification.EPSS 1.7%

Source: NIST National Vulnerability Database (record CVE-2021-41282), CISA KEV, FIRST EPSS (scores of 2026-09-24). This page is refreshed as NVD updates the record.