Skip to content

Conversation

huguestennier
Copy link
Collaborator

@huguestennier huguestennier commented Aug 18, 2025

Potential fix for https://github.com/HumanSignal/label-studio/security/code-scanning/794

To fix the issue, we need to ensure that the name value derived from tab.dataset.name is properly sanitized or escaped before being used in the buttons string. The best approach is to use a utility function to escape special HTML characters (<, >, &, ", ') in the name value. This ensures that any potentially malicious input is rendered as plain text rather than being interpreted as HTML.

The fix involves:

  1. Adding a helper function escapeHTML to escape special HTML characters.
  2. Using this function to sanitize the name value before appending it to the buttons string.

Testing

Tabs component under https://deploy-preview-8172--heartex-docs.netlify.app/guide/export#COCO should work as before

Screenshot 2025-08-18 at 9 18 58 AM

…preted as HTML

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Copy link

netlify bot commented Aug 18, 2025

Deploy Preview for label-studio-docs-new-theme ready!

Name Link
🔨 Latest commit 90d9ee8
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-docs-new-theme/deploys/68a326048853d5000850ac75
😎 Deploy Preview https://deploy-preview-8172--label-studio-docs-new-theme.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

netlify bot commented Aug 18, 2025

Deploy Preview for heartex-docs ready!

Name Link
🔨 Latest commit 90d9ee8
🔍 Latest deploy log https://app.netlify.com/projects/heartex-docs/deploys/68a32604ce9f6c0008c75890
😎 Deploy Preview https://deploy-preview-8172--heartex-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

netlify bot commented Aug 18, 2025

Deploy Preview for label-studio-storybook canceled.

Name Link
🔨 Latest commit 90d9ee8
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-storybook/deploys/68a326046cb590000808db86

Copy link

netlify bot commented Aug 18, 2025

Deploy Preview for label-studio-playground canceled.

Name Link
🔨 Latest commit 90d9ee8
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-playground/deploys/68a326042fc0c50008e6ed14

@huguestennier huguestennier changed the title Potential fix for code scanning alert no. 794: DOM text reinterpreted as HTML docs: Potential fix for code scanning alert no. 794: DOM text reinterpreted as HTML Aug 18, 2025
@huguestennier huguestennier marked this pull request as ready for review August 18, 2025 13:10
@huguestennier huguestennier requested a review from niklub August 18, 2025 13:20
@niklub niklub merged commit 3cbcda5 into develop Aug 19, 2025
73 of 78 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants