Nuxt · Security
NUXT0055Avoid unsafe scripts in useHead
Flags unsafe usehead script in Nuxt security code before it leaks into runtime behavior.
vite-doctor/nuxtsecurityerrorSuggestion
Why it happens
Untrusted HTML and scripts are high-risk rendering surfaces. Keep them explicit, constrained, and routed through framework APIs that encode intent.
Fix
Remove unsafe usehead script, or move it to the Nuxt runtime/API that owns that behavior.
Example
Avoid unsafe usehead script
Before
useHead({
script: [{ src: 'https://example.com/widget.js' }],
})
After
useHeadSafe({
script: [{ src: trustedWidgetUrl }],
})
Verify the fix
Run only this rule after editing so the report stays focused on the diagnostic you are closing:
pnpm nuxt doctor --rules nuxt/security/no-unsafe-usehead-script