Repository navigation
fix(kms): pin the onboarding page's vue build and check its integrity - #1396
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The first-boot KMS setup page (
dstack/kms/src/www/onboard.html) loadshttps://unpkg.com/vue@3/dist/vue.global.js: a floating major-version tag with nointegrityattribute. Whatever unpkg serves forvue@3at page load runs in the same origin as the/prpc/Onboard.*endpoints. That script sees the source KMS URL and, since #1307, thesource_tokenthe operator types for the source KMS admin listener, and it can callBootstrap/Onboardwith 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 withcrossorigin="anonymous". If the browser receives other bytes, it refuses to run them.The digest
sha384-6pS1WSZJY7wOk6qQTa9C9U2W1/qzqL7iYoMil7qn9KFeN5fZDAwIExgCd7U5AH+Xis 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 -Agives the digest above. The jsDelivr copy gives the same value.--dump-dom). With the pinned digest, Vue mounts: the Bootstrap/Onboard buttons render and no{{ }}/v-ifmarkup 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.