Retained rows in shared_machines may cause nodes to be accidentally shared later on. #115

Closed
opened 2025-12-29 01:23:28 +01:00 by adam · 1 comment
Owner

Originally created by @enoperm on GitHub (Feb 6, 2022).

Bug description

Namespace IDs may get reused after consecutive destroy and create operations.
Internally, shared nodes are represented as a separate relation that maps a machine ID with a destination namespace ID.
While machines belonging to the namespace are removed upon destroying a namespace, shared machines are left untouched.
When a new namespace is created later on, machines previously shared with the old namespace will be treated as shared with the new namespace without further user action or notice.

  • Create namespace to hold a test node to be shared: owner
  • Create initial namespace to share with: another
  • Share a node from owner to another
  • Destroy another.
  • Create new namespace yet-another
  • Observe the previously chosen test node being shared with the namespace yet-another.

Context info

  • Version of headscale used: 0.13.0-beta1
Originally created by @enoperm on GitHub (Feb 6, 2022). **Bug description** <!-- A clear and concise description of what the bug is. Describe the expected bahavior and how it is currently different. If you are unsure if it is a bug, consider discussing it on our Discord server first. --> Namespace IDs may get reused after consecutive `destroy` and `create` operations. Internally, shared nodes are represented as a separate relation that maps a machine ID with a destination namespace ID. While machines belonging to the namespace are removed upon destroying a namespace, shared machines are left untouched. When a new namespace is created later on, machines previously shared with the old namespace will be treated as shared with the new namespace without further user action or notice. <!-- Steps to reproduce the behavior. --> * Create namespace to hold a test node to be shared: `owner` * Create initial namespace to share with: `another` * Share a node from `owner` to `another` * Destroy `another`. * Create new namespace `yet-another` * Observe the previously chosen test node being shared with the namespace `yet-another`. **Context info** - Version of headscale used: `0.13.0-beta1`
adam added the bug label 2025-12-29 01:23:28 +01:00
adam closed this issue 2025-12-29 01:23:28 +01:00
Author
Owner

@kradalby commented on GitHub (Mar 20, 2022):

Shared machines has been removed, so this is no longer a concern

@kradalby commented on GitHub (Mar 20, 2022): Shared machines has been removed, so this is no longer a concern
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#115