docs: add XSS safety comment for VM display name annotation (#1019) (#1020)

(cherry picked from commit b813bc578e09f60a0cebb3e8e9dc824e03f78960)

Signed-off-by: Andy Lee <andy.lee@suse.com>
Co-authored-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
mergify[bot] 2026-07-17 17:32:24 +08:00 committed by GitHub
parent e99e4ef34f
commit 1496c17f3d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -93,6 +93,9 @@ export default {
const hostname = this.value.spec.template.spec.hostname || '';
// Display name can contain arbitrary strings. There is no XSS risk because the value is
// rendered via Vue's {{ }} interpolation which auto-escapes HTML; v-html is never used for
// this field. See harvester/harvester#10423 for details.
const customizeDisplayName = !!(this.value.metadata?.annotations?.[HCI_ANNOTATIONS.VM_DISPLAY_NAME]);
return {