CVE-2025-22021: Vulnerability in Linux Linux
In the Linux kernel, the following vulnerability has been resolved: netfilter: socket: Lookup orig tuple for IPv6 SNAT nf_sk_lookup_slow_v4 does the conntrack lookup for IPv4 packets to restore the original 5-tuple in case of SNAT, to be able to find the right socket (if any). Then socket_match() can correctly check whether the socket was transparent. However, the IPv6 counterpart (nf_sk_lookup_slow_v6) lacks this conntrack lookup, making xt_socket fail to match on the socket when the packet was SNATed. Add the same logic to nf_sk_lookup_slow_v6. IPv6 SNAT is used in Kubernetes clusters for pod-to-world packets, as pods' addresses are in the fd00::/8 ULA subnet and need to be replaced with the node's external address. Cilium leverages Envoy to enforce L7 policies, and Envoy uses transparent sockets. Cilium inserts an iptables prerouting rule that matches on `-m socket --transparent` and redirects the packets to localhost, but it fails to match SNATed IPv6 packets due to that missing conntrack lookup.
AI Analysis
Technical Summary
CVE-2025-22021 is a vulnerability in the Linux kernel's netfilter subsystem affecting the handling of IPv6 packets subject to Source Network Address Translation (SNAT). Specifically, the vulnerability arises because the IPv6 path for socket lookup (nf_sk_lookup_slow_v6) does not perform a connection tracking (conntrack) lookup to restore the original 5-tuple of a packet after SNAT, unlike its IPv4 counterpart (nf_sk_lookup_slow_v4). This omission causes the xt_socket match extension, which relies on socket transparency checks, to fail when processing SNATed IPv6 packets. The practical impact is that packets originating from Kubernetes pods using IPv6 Unique Local Addresses (fd00::/8) and translated to the node's external IPv6 address cannot be correctly matched by iptables rules that use the socket match with the --transparent flag. This affects setups like Cilium, a popular Kubernetes networking and security solution that leverages Envoy proxies and iptables rules to enforce Layer 7 policies via transparent sockets. Because the kernel fails to match SNATed IPv6 packets to the correct socket, policy enforcement and packet redirection may not function as intended, potentially leading to bypasses or disruptions in network security controls within Kubernetes clusters using IPv6 SNAT. The vulnerability was resolved by adding the missing conntrack lookup logic to nf_sk_lookup_slow_v6, aligning IPv6 behavior with IPv4. The affected versions are specific Linux kernel commits prior to the fix. No known exploits are reported in the wild as of the publication date (April 16, 2025).
Potential Impact
For European organizations, especially those operating Kubernetes clusters with IPv6 networking and using Cilium or similar tools for network policy enforcement, this vulnerability could undermine critical security controls. The failure to match SNATed IPv6 packets to the correct socket may allow unauthorized traffic to bypass Layer 7 filtering or cause legitimate traffic to be dropped, impacting confidentiality, integrity, and availability of services. This is particularly relevant for enterprises and cloud providers adopting IPv6 and container orchestration at scale. Disruptions in network policy enforcement could expose sensitive internal services or data to unauthorized access or lateral movement within the network. Additionally, organizations relying on transparent socket-based proxies like Envoy for microservices security may experience degraded security posture or operational instability. While no active exploitation is known, the vulnerability presents a risk vector that could be targeted once widely understood, especially in environments with complex IPv6 SNAT configurations.
Mitigation Recommendations
1. Upgrade the Linux kernel to a version that includes the patch fixing CVE-2025-22021 as soon as it becomes available. Monitor vendor advisories for updated kernel releases. 2. In Kubernetes environments using Cilium or similar, verify that the network policies and iptables rules relying on socket matching behave as expected post-upgrade. 3. Temporarily, consider disabling IPv6 SNAT or adjusting network policies to minimize reliance on transparent socket matches for SNATed IPv6 traffic if kernel upgrades are delayed. 4. Employ additional network monitoring and anomaly detection to identify unexpected traffic flows that might indicate bypasses of Layer 7 policies. 5. Review and test Envoy and other proxy configurations to ensure they handle IPv6 SNAT traffic correctly after patching. 6. Maintain strict access controls and segmentation to limit the impact of any potential policy enforcement failures. 7. Engage with Linux kernel and Kubernetes security communities for best practices and updates related to IPv6 SNAT handling.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland, Denmark, Belgium, Ireland, Spain
CVE-2025-22021: Vulnerability in Linux Linux
Description
In the Linux kernel, the following vulnerability has been resolved: netfilter: socket: Lookup orig tuple for IPv6 SNAT nf_sk_lookup_slow_v4 does the conntrack lookup for IPv4 packets to restore the original 5-tuple in case of SNAT, to be able to find the right socket (if any). Then socket_match() can correctly check whether the socket was transparent. However, the IPv6 counterpart (nf_sk_lookup_slow_v6) lacks this conntrack lookup, making xt_socket fail to match on the socket when the packet was SNATed. Add the same logic to nf_sk_lookup_slow_v6. IPv6 SNAT is used in Kubernetes clusters for pod-to-world packets, as pods' addresses are in the fd00::/8 ULA subnet and need to be replaced with the node's external address. Cilium leverages Envoy to enforce L7 policies, and Envoy uses transparent sockets. Cilium inserts an iptables prerouting rule that matches on `-m socket --transparent` and redirects the packets to localhost, but it fails to match SNATed IPv6 packets due to that missing conntrack lookup.
AI-Powered Analysis
Technical Analysis
CVE-2025-22021 is a vulnerability in the Linux kernel's netfilter subsystem affecting the handling of IPv6 packets subject to Source Network Address Translation (SNAT). Specifically, the vulnerability arises because the IPv6 path for socket lookup (nf_sk_lookup_slow_v6) does not perform a connection tracking (conntrack) lookup to restore the original 5-tuple of a packet after SNAT, unlike its IPv4 counterpart (nf_sk_lookup_slow_v4). This omission causes the xt_socket match extension, which relies on socket transparency checks, to fail when processing SNATed IPv6 packets. The practical impact is that packets originating from Kubernetes pods using IPv6 Unique Local Addresses (fd00::/8) and translated to the node's external IPv6 address cannot be correctly matched by iptables rules that use the socket match with the --transparent flag. This affects setups like Cilium, a popular Kubernetes networking and security solution that leverages Envoy proxies and iptables rules to enforce Layer 7 policies via transparent sockets. Because the kernel fails to match SNATed IPv6 packets to the correct socket, policy enforcement and packet redirection may not function as intended, potentially leading to bypasses or disruptions in network security controls within Kubernetes clusters using IPv6 SNAT. The vulnerability was resolved by adding the missing conntrack lookup logic to nf_sk_lookup_slow_v6, aligning IPv6 behavior with IPv4. The affected versions are specific Linux kernel commits prior to the fix. No known exploits are reported in the wild as of the publication date (April 16, 2025).
Potential Impact
For European organizations, especially those operating Kubernetes clusters with IPv6 networking and using Cilium or similar tools for network policy enforcement, this vulnerability could undermine critical security controls. The failure to match SNATed IPv6 packets to the correct socket may allow unauthorized traffic to bypass Layer 7 filtering or cause legitimate traffic to be dropped, impacting confidentiality, integrity, and availability of services. This is particularly relevant for enterprises and cloud providers adopting IPv6 and container orchestration at scale. Disruptions in network policy enforcement could expose sensitive internal services or data to unauthorized access or lateral movement within the network. Additionally, organizations relying on transparent socket-based proxies like Envoy for microservices security may experience degraded security posture or operational instability. While no active exploitation is known, the vulnerability presents a risk vector that could be targeted once widely understood, especially in environments with complex IPv6 SNAT configurations.
Mitigation Recommendations
1. Upgrade the Linux kernel to a version that includes the patch fixing CVE-2025-22021 as soon as it becomes available. Monitor vendor advisories for updated kernel releases. 2. In Kubernetes environments using Cilium or similar, verify that the network policies and iptables rules relying on socket matching behave as expected post-upgrade. 3. Temporarily, consider disabling IPv6 SNAT or adjusting network policies to minimize reliance on transparent socket matches for SNATed IPv6 traffic if kernel upgrades are delayed. 4. Employ additional network monitoring and anomaly detection to identify unexpected traffic flows that might indicate bypasses of Layer 7 policies. 5. Review and test Envoy and other proxy configurations to ensure they handle IPv6 SNAT traffic correctly after patching. 6. Maintain strict access controls and segmentation to limit the impact of any potential policy enforcement failures. 7. Engage with Linux kernel and Kubernetes security communities for best practices and updates related to IPv6 SNAT handling.
For access to advanced analysis and higher rate limits, contact root@offseq.com
Technical Details
- Data Version
- 5.1
- Assigner Short Name
- Linux
- Date Reserved
- 2024-12-29T08:45:45.807Z
- Cisa Enriched
- false
- Cvss Version
- null
- State
- PUBLISHED
Threat ID: 682d9831c4522896dcbe7e86
Added to database: 5/21/2025, 9:09:05 AM
Last enriched: 7/3/2025, 7:55:10 PM
Last updated: 7/29/2025, 7:27:18 PM
Views: 17
Related Threats
CVE-2025-3892: CWE-250: Execution with Unnecessary Privileges in Axis Communications AB AXIS OS
MediumCVE-2025-30027: CWE-1287: Improper Validation of Specified Type of Input in Axis Communications AB AXIS OS
MediumCVE-2025-7622: CWE-918: Server-Side Request Forgery (SSRF) in Axis Communications AB AXIS Camera Station Pro
MediumCVE-2025-8314: CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in emarket-design Project Management, Bug and Issue Tracking Plugin – Software Issue Manager
MediumCVE-2025-8059: CWE-862 Missing Authorization in bplugins B Blocks – The ultimate block collection
CriticalActions
Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.