Stored cross-site scripting (XSS) occurs because the survey-level Custom Head Scripts feature fails to enforce the required Manage permission boundary. A workspace member with `readWrite` permissions can configure Custom Head Scripts on a survey, despite this action being restricted to the Manage role. This allows a lower-privileged user to execute arbitrary JavaScript within the authenticated browser session of any user who opens the affected survey, including higher-privileged users.