You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"sanity: attacker forging victim's source IP must be rejected when no conntrack entry exists")
974
+
975
+
got:=fw.Drop(flow, true, &attackerHI, cp, nil)
976
+
t.Logf("attacker replaying victim's 4-tuple: Drop returned %v (nil == packet ALLOWED == spoof succeeded)", got)
977
+
assert.Equal(t, ErrInvalidRemoteIP, got,
978
+
"SECURITY: attacker spoofed victim's overlay source IP (192.0.2.2) by reusing an existing conntrack 4-tuple; Drop returned %v instead of rejecting", got)
979
+
}
980
+
981
+
// BenchmarkFirewallDropConntrackHit measures Drop on an already-established flow
982
+
// (a conntrack hit). This is the fast path that the source-IP<->cert binding
983
+
// reordering adds work to, so it quantifies the cost of moving the address checks
984
+
// ahead of the conntrack lookup. Cases:
985
+
// - simple: peer cert has one address, no unsafe networks (h.networks == nil),
986
+
// so the remote-address check is a single netip.Addr compare.
987
+
// - complex: peer cert has unsafe networks (h.networks populated), so the
988
+
// remote-address check is a BART lookup.
989
+
// - noCache/localCache: whether a per-batch ConntrackCache is supplied, which in
990
+
// the original code let the fast path skip straight past the address checks.
0 commit comments