Skip to content

Commit 33f7a29

Browse files
committed
Fix MMDS iptables rule to use ACCEPT instead of RETURN
The RETURN target in user-defined chains does not prevent subsequent rules in the parent chain from matching. When MMDS traffic hits RETURN, it continues evaluation at the next rule in PREROUTING/OUTPUT where user REDIRECT rules can still hijack the traffic. Using ACCEPT terminates all NAT rule evaluation for the packet, preventing any subsequent REDIRECT rules from matching MMDS traffic.
1 parent 37c4de7 commit 33f7a29

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/envd/internal/host/mmds_route_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func PinMMDSRoute(ctx context.Context) {
1818
commands := [][]string{
1919
{"-N", "E2B_MMDS"},
2020
{"-F", "E2B_MMDS"},
21-
{"-A", "E2B_MMDS", "-d", "169.254.169.254", "-p", "tcp", "--dport", "80", "-j", "RETURN"},
21+
{"-A", "E2B_MMDS", "-d", "169.254.169.254", "-p", "tcp", "--dport", "80", "-j", "ACCEPT"},
2222
{"-D", "PREROUTING", "-j", "E2B_MMDS"},
2323
{"-I", "PREROUTING", "1", "-j", "E2B_MMDS"},
2424
{"-D", "OUTPUT", "-j", "E2B_MMDS"},

0 commit comments

Comments
 (0)