/

CVE-2026-111223

Severity:

HIGH RISK

(7.2)

Configuration Injection (CWE-74) in pfSense IPsec Mobile

CVE-2026-111223

Analyzed

Vulnerability type

Category:

Configuration Injection

CWE:

CWE-74

Impact:

Root-level Command Execution

Severity:

HIGH RISK

(7.2)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A configuration injection vulnerability in Netgate pfSense CE allows authenticated users with IPsec Mobile privileges to insert directives into the generated strongSwan configuration. Under certain restart conditions, the injected directives may cause commands to execute with root privileges.

A configuration injection vulnerability in Netgate pfSense CE allows authenticated users with IPsec Mobile privileges to insert directives into the generated strongSwan configuration. Under certain restart conditions, the injected directives may cause commands to execute with root privileges.

Affected context

The issue affects pfSense CE deployments using the IPsec Mobile configuration flow when the login_banner value is incorporated into strongSwan configuration without sufficient escaping or structural validation. Exploitation depends on the attacker having authenticated IPsec Mobile privileges and on a service restart or other configuration reload that causes strongSwan to process the generated file.

The issue affects pfSense CE deployments using the IPsec Mobile configuration flow when the login_banner value is incorporated into strongSwan configuration without sufficient escaping or structural validation. Exploitation depends on the attacker having authenticated IPsec Mobile privileges and on a service restart or other configuration reload that causes strongSwan to process the generated file.

Exploit preconditions

  • Attack surface: The pfSense IPsec Mobile configuration interface or related authenticated configuration path
  • Required access: An authenticated account with IPsec Mobile privileges
  • Trigger point: Generation and subsequent reload or restart of the strongSwan service
  • Why exploitation is possible: The login_banner value can alter the structure of an unquoted strongSwan configuration attribute, allowing attacker-controlled service directives to be interpreted as configuration rather than banner text
  • Attack surface: The pfSense IPsec Mobile configuration interface or related authenticated configuration path
  • Required access: An authenticated account with IPsec Mobile privileges
  • Trigger point: Generation and subsequent reload or restart of the strongSwan service
  • Why exploitation is possible: The login_banner value can alter the structure of an unquoted strongSwan configuration attribute, allowing attacker-controlled service directives to be interpreted as configuration rather than banner text

Why this happens

The vulnerability results from embedding attacker-influenced text into a structured strongSwan configuration value without context-aware escaping and strict validation. Because the value is not safely bounded to its intended field, special syntax can terminate the original attribute and introduce additional configuration entries, including startup actions. This behavior maps to CWE-74, Improper Neutralization of Special Elements in Output Used by a Downstream Component, because data intended as content is interpreted as control syntax by the downstream configuration parser.

The vulnerability results from embedding attacker-influenced text into a structured strongSwan configuration value without context-aware escaping and strict validation. Because the value is not safely bounded to its intended field, special syntax can terminate the original attribute and introduce additional configuration entries, including startup actions. This behavior maps to CWE-74, Improper Neutralization of Special Elements in Output Used by a Downstream Component, because data intended as content is interpreted as control syntax by the downstream configuration parser.

Potential impact

  • An attacker may execute operating-system commands with root privileges.
  • The attacker could alter firewall, VPN, or system configuration.
  • The compromise may enable persistence or broader access to the appliance.
  • Network traffic, credentials, or protected administrative data could be exposed.
  • The device could be disrupted or used to affect connected networks.
  • An attacker may execute operating-system commands with root privileges.
  • The attacker could alter firewall, VPN, or system configuration.
  • The compromise may enable persistence or broader access to the appliance.
  • Network traffic, credentials, or protected administrative data could be exposed.
  • The device could be disrupted or used to affect connected networks.

General mitigation guidance

Mitigation generally focuses on preserving the trust boundary between user

input and generated service configuration.

Common defensive patterns include:

  • Encoding or escaping values according to the exact syntax expected by the downstream parser.
  • Restricting login banners to a narrowly defined allowlist of safe characters and lengths.
  • Generating configuration through structured APIs or templates that cannot introduce new directives.
  • Validating the complete generated configuration before it is accepted or reloaded.
  • Running service components with the least privileges compatible with their function.
  • Limiting which authenticated roles can modify IPsec-related settings and trigger reloads.

Mitigation generally focuses on preserving the trust boundary between user

input and generated service configuration.

Common defensive patterns include:

  • Encoding or escaping values according to the exact syntax expected by the downstream parser.
  • Restricting login banners to a narrowly defined allowlist of safe characters and lengths.
  • Generating configuration through structured APIs or templates that cannot introduce new directives.
  • Validating the complete generated configuration before it is accepted or reloaded.
  • Running service components with the least privileges compatible with their function.
  • Limiting which authenticated roles can modify IPsec-related settings and trigger reloads.

How teams detect issues like this

Detection approaches may include:

  • Static analysis for direct interpolation of user-controlled values into strongSwan or other service configuration files.
  • Code review checks for unquoted template fields, missing context-specific escaping, and insufficient allowlist validation.
  • Tests that submit delimiter characters and verify that generated configuration remains structurally unchanged.
  • Monitoring configuration changes, service restarts, and unexpected startup-script directives.
  • Policy enforcement requiring schema validation and security review for generated privileged-service configurations.

Automated security and code-review tools may help identify unsafe output construction patterns.

Detection approaches may include:

  • Static analysis for direct interpolation of user-controlled values into strongSwan or other service configuration files.
  • Code review checks for unquoted template fields, missing context-specific escaping, and insufficient allowlist validation.
  • Tests that submit delimiter characters and verify that generated configuration remains structurally unchanged.
  • Monitoring configuration changes, service restarts, and unexpected startup-script directives.
  • Policy enforcement requiring schema validation and security review for generated privileged-service configurations.

Automated security and code-review tools may help identify unsafe output construction patterns.

Sources

SourceLink
abraxaslabs.techabraxaslabs.tech/research/pfsense-ce-leftovers
abraxaslabs.techabraxaslabs.tech/research/pfsense-ipsec-login-banner
github.comgithub.com/abraxas/pfsense-ipsec-login-banner
github.comgithub.com/pfsense/pfsense/blob/9363ac5b8651a1c7a333180425ce7719070f95f9/src/etc/inc/ipsec.inc#L1361-L1388
github.comgithub.com/pfsense/pfsense/blob/9363ac5b8651a1c7a333180425ce7719070f95f9/src/etc/inc/ipsec.inc#L1842-L1845
github.comgithub.com/pfsense/pfsense/blob/9363ac5b8651a1c7a333180425ce7719070f95f9/src/usr/local/www/vpn_ipsec_mobile.php#L269-L273
github.comgithub.com/pfsense/pfsense/commit/27a52d0807
vulncheck.comvulncheck.com/advisories/netgate-pfsense-ce-2.7.0-through-2.9.0-command-injection-via-ipsec-mobile-login-banner

Frequently asked

questions

It may be exploitable through the pfSense management interface, but exploitation

requires authenticated access with the necessary IPsec Mobile privileges and

depends on the appliance's configuration and restart behavior.

Full system administration is not necessarily required. The relevant prerequisite

is an authenticated role permitted to manage the affected IPsec Mobile settings.

Treat banner content strictly as data: apply context-specific escaping, enforce a

restrictive allowlist, and validate the resulting configuration before any

privileged service reload.

Avoid concatenating untrusted values into executable or structured configuration,

use safe structured-generation mechanisms, test delimiter and metacharacter

handling, and apply least privilege to configuration and service operations.

It may be exploitable through the pfSense management interface, but exploitation

requires authenticated access with the necessary IPsec Mobile privileges and

depends on the appliance's configuration and restart behavior.

Full system administration is not necessarily required. The relevant prerequisite

is an authenticated role permitted to manage the affected IPsec Mobile settings.

Treat banner content strictly as data: apply context-specific escaping, enforce a

restrictive allowlist, and validate the resulting configuration before any

privileged service reload.

Avoid concatenating untrusted values into executable or structured configuration,

use safe structured-generation mechanisms, test delimiter and metacharacter

handling, and apply least privilege to configuration and service operations.

Find out what's already
exploitable in your codebase.