ipn,magicsock: deny peer capabilities to unsigned peers (#20561)
Unsigned peers aren't covered by tailnet lock, so they must never hold peer capabilities even if the packet filter grants them. This change extends the check for unsigned-peers to ensure full coverage in capabilities. Fixes tailscale/corp#45116 Change-Id: I918af24f0b9855e55921cbdad109cc68e745e125 Signed-off-by: Mike Jensen <mikej@tailscale.com>
This commit is contained in:
@@ -406,6 +406,12 @@ func upgradeNode(n *tailcfg.Node) {
|
||||
if n.AllowedIPs == nil {
|
||||
n.AllowedIPs = slices.Clone(n.Addresses)
|
||||
}
|
||||
// Unsigned peers aren't covered by tailnet lock, so a (possibly malicious)
|
||||
// control server must not grant them network access via advertised routes.
|
||||
// Strip any AllowedIPs beyond their own addresses.
|
||||
if n.UnsignedPeerAPIOnly && !slices.Equal(n.AllowedIPs, n.Addresses) {
|
||||
n.AllowedIPs = slices.Clone(n.Addresses)
|
||||
}
|
||||
}
|
||||
|
||||
func (ms *mapSession) tryHandleIncrementally(res *tailcfg.MapResponse) bool {
|
||||
|
||||
Reference in New Issue
Block a user