Skip to content

fix(kms): pin the onboarding page's vue build and check its integrity - #1396

Merged
kvinwang merged 1 commit into
nextfrom
fix/kms-onboard-vue-sri
Sep 25, 2026
Merged

kvinwang merged 1 commit into
nextfrom
fix/kms-onboard-vue-sri

Conversation

@kvinwang

Copy link
Copy Markdown
Collaborator

Problem

The first-boot KMS setup page (dstack/kms/src/www/onboard.html) loads https://unpkg.com/vue@3/dist/vue.global.js: a floating major-version tag with no integrity attribute. Whatever unpkg serves for vue@3 at page load runs in the same origin as the /prpc/Onboard.* endpoints. That script sees the source KMS URL and, since #1307, the source_token the operator types for the source KMS admin listener, and it can call Bootstrap/Onboard with its own parameters. A new Vue release also changes the page's code without any change in this repository.

Fix

Pin the exact release the VMM console already uses (vue@3.4.21, production build) and add a Subresource Integrity digest with crossorigin="anonymous". If the browser receives other bytes, it refuses to run them.

The digest sha384-6pS1WSZJY7wOk6qQTa9C9U2W1/qzqL7iYoMil7qn9KFeN5fZDAwIExgCd7U5AH+X is the same for the file served by unpkg and by jsDelivr.

Verification

  • curl -sSfL https://unpkg.com/vue@3.4.21/dist/vue.global.prod.js | openssl dgst -sha384 -binary | openssl base64 -A gives the digest above. The jsDelivr copy gives the same value.
  • Served the page locally and rendered it with headless Chromium (--dump-dom). With the pinned digest, Vue mounts: the Bootstrap/Onboard buttons render and no {{ }}/v-if markup is left in the DOM. With one character of the digest changed, the browser blocks the script and 28 raw template markers stay in the DOM.

@kvinwang
kvinwang merged commit 8844ee9 into next Sep 25, 2026
11 checks passed
@kvinwang
kvinwang deleted the fix/kms-onboard-vue-sri branch September 25, 2026 00:37
kvinwang added a commit that referenced this pull request Sep 25, 2026
…d ct_monitor

tc-kms-build-001 now requires --locked on every dstack cargo build in the
builder images (#1403), a versioned, integrity-checked Vue script on the
onboarding page (#1396), and the ct_monitor scan tests (#1349), whose binary
talks to crt.sh directly and cannot run hermetically.

Signed-off-by: Kevin Wang <wy721@qq.com>
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