Run welcome message through DOMPurify before rendering it#1378
Merged
nscuro merged 1 commit intoDependencyTrack:masterfrom Nov 12, 2025
Merged
Run welcome message through DOMPurify before rendering it#1378nscuro merged 1 commit intoDependencyTrack:masterfrom
nscuro merged 1 commit intoDependencyTrack:masterfrom
Conversation
Signed-off-by: nscuro <nscuro@protonmail.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
There was a problem hiding this comment.
Pull Request Overview
This PR adds XSS protection by sanitizing HTML content in welcome messages using DOMPurify before rendering them in the UI. This is a security enhancement that prevents potential cross-site scripting attacks through user-configurable HTML content.
- Imported DOMPurify library in both Login and WelcomeMessage components
- Sanitized welcome message content before rendering with
v-html - Created a computed property in WelcomeMessage for sanitization to maintain separation of concerns
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/views/pages/Login.vue | Imported DOMPurify and sanitized the welcome message during API response handling |
| src/views/administration/configuration/WelcomeMessage.vue | Imported DOMPurify, added computed property for sanitized message, and updated template to use sanitized version |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Description
Runs welcome message through DOMPurify before rendering it.
Addressed Issue
N/A
Additional Details
N/A
Checklist
This PR introduces new or alters existing behavior, and I have updated the documentation accordingly