The vulnerability, CVE-2025-9039, allows for an information disclosure in the Amazon ECS Container Agent due to improper validation of IPv6 configuration before applying firewall rules. The introspection server, which provides metadata about the agent and container instances, could be accessed from off-host if IPv6 was enabled but not fully configured on the host, causing ip6tables rules to fail silently.
The analysis of the patch between version 1.97.0 (vulnerable) and 1.97.1 (patched) revealed that the core of the fix lies within the ecs-init/exec/iptables/iptables.go file. Specifically, the modifyNetfilterEntry function was modified to include a check for the existence of the IPv6 kernel configuration before attempting to apply ip6tables rules. This prevents the agent from leaving the introspection server's IPv6 endpoint unprotected.
The primary vulnerable function is iptables.NetfilterRoute.modifyNetfilterEntry, as it contained the flawed logic. The iptables.NetfilterRoute.Create function is also identified as a key function, as it is the entry point that triggers the vulnerable logic during the agent's startup and firewall setup. The addition of the iptables.checkIpv6KernelConfigExist function in the patch is the direct mitigation for the vulnerability.
An engineer with this CVE in their environment should understand that the risk lies in environments where IPv6 is enabled at the OS level but not fully configured, which could lead to the exposure of sensitive instance and container metadata. The recommended action is to upgrade the ECS agent to version 1.97.1 or later, or, as a workaround, to use security groups to restrict access to the introspection server port (51678).