Skip to content

fix: warn on an instance_id_seed that is not 20 bytes - #1607

Open
kvinwang wants to merge 1 commit into
nextfrom
fix/instance-id-seed-length
Open

kvinwang wants to merge 1 commit into
nextfrom
fix/instance-id-seed-length

Conversation

@kvinwang

Copy link
Copy Markdown
Collaborator

instance_id = sha256(seed || app_id [|| binding])[..20] takes a host-supplied seed of any length, so the instance id is unique only together with the app id. Every producer in this repo generates 20 bytes; rejecting or rewriting another length would fail the boot or change an existing CVM's identity, so this only warns:

  • the guest logs a warning when the host's seed is not 20 bytes;
  • dstack-cloud warns when a project's instance_id_seed is not 40 hex chars;
  • docs/security/cvm-boundaries.md documents the 20-byte seed, the platform binding in the formula, and that instances are identified by (app_id, instance_id).

From the Lean model of the derivation (#1597, InstanceId.lean).

@kvinwang
kvinwang enabled auto-merge November 18, 2026 08:51
Signed-off-by: Kevin Wang <wy721@qq.com>
@kvinwang
kvinwang force-pushed the fix/instance-id-seed-length branch from 934a059 to 6f4dc6a Compare November 18, 2026 10:29

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant