NetworkManager-l2tp flaws allow local privilege escalation
Three CVEs cover unsanitized VPN properties, usernames, and MRU or MTU values written into IPsec or pppd files.
Root Privilege Escalation via pppd Option Injection in NetworkManager-l2tp
NetworkManager-l2tp, a Linux NetworkManager plugin for L2TP/IPsec VPNs, fails to safely handle the VPN username when it generates options for pppd, which runs as root. A local user who is permitted to create VPN connections can embed a double-quote character or whitespace in the username, breaking out of the quoting context in the pppd options file and injecting additional pppd options, including a plugin directive pointing to an attacker-controlled shared object. When the VPN connection is brought up, the privileged pppd process loads that shared object and executes attacker-chosen code with root privileges. All versions through 1.52.4 are affected; on many desktop Linux distributions the primary user can create VPN connections by default, so even a user-level compromise (such as malware running as the desktop user) could pivot to full root on an affected host. No exploitation in the wild is known, there is no public proof of concept, and the flaw is not on CISA's KEV list.
What to do: Upgrade to NetworkManager-l2tp 1.52.6 or later, or apply your distribution's patched/backported package as soon as it ships. Until patched, restrict who can create or modify VPN connections (tighten polkit rules for NetworkManager settings changes and remove untrusted users from groups such as netdev). Also audit existing VPN profiles for usernames containing quotes or whitespace and look for unexpected pppd plugin shared objects on hosts where the package is installed, treating any prior local account compromise on an affected machine as a potential root compromise.
| Product | Affected |
|---|---|
| nm-l2tp project (NetworkManager-l2tp upstream) NetworkManager-l2tp | All versions through 1.52.4 (fixed in 1.52.6) |
Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.
NetworkManager-l2tp through 1.52.4, fixed in 1.52.6, contains a privilege escalation vulnerability that allows local users with permission to create VPN connections to execute arbitrary code as root by injecting pppd options through a crafted VPN username. Attackers can embed a double-quote character or whitespace in the username to break out of the pppd options file quoting context and include the pppd plugin directive, causing the privileged pppd process to load an attacker-controlled shared object.
Three CVEs cover unsanitized VPN properties, usernames, and MRU or MTU values written into IPsec or pppd files.
Today 2.9K readers · 6.7K views · 611 reads · all time 292K views