Skip to content

Potential fix for code scanning alert no. 1: DOM text reinterpreted as HTML - #2

Merged
Nicofire merged 1 commit into
mainfrom
alert-autofix-1
Nov 6, 2026
Merged

Nicofire merged 1 commit into
mainfrom
alert-autofix-1

Conversation

@Nicofire

@Nicofire Nicofire commented Nov 6, 2026

Copy link
Copy Markdown
Owner

Potential fix for https://github.com/Nicofire/Queue-Studio/security/code-scanning/1

The best fix is to validate and constrain all image src values before rendering. In this component, previewSrc should only allow safe image URL forms actually expected by the feature:

  • blob: URLs created from local file selections
  • data:image/...;base64,... for generated previews
  • http: / https: and root-relative paths for existing stored images

Implement a small helper in src/components/CategoryEntryModal.tsx (near mapImagePath) to sanitize candidate image sources and return '' for anything unexpected. Then apply it when computing previewSrc so line 416 only receives vetted values. This preserves existing functionality while preventing untrusted/unsupported schemes from reaching the DOM sink.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…s HTML

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@Nicofire
Nicofire marked this pull request as ready for review November 6, 2026 08:45
@Nicofire
Nicofire requested a balanced review from Copilot November 6, 2026 08:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@Nicofire
Nicofire merged commit 8c52c8b into main Nov 6, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants