Skip to content

Conversation

@oyeaussie
Copy link
Contributor

No description provided.

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

'{{componentId}}-{{sectionId}}-name' : {
afterInit : function() {
$('#{{componentId}}-{{sectionId}}-name').keyup(function(e) {
$('#swatch-preview').html($('#{{componentId}}-{{sectionId}}-name').val());

Check failure

Code scanning / CodeQL

DOM text reinterpreted as HTML High

DOM text
is reinterpreted as HTML without escaping meta-characters.

Copilot Autofix

AI 7 months ago

To fix the issue, replace the use of .html() with .text(). The .text() method ensures that the input is treated as plain text and not interpreted as HTML, thereby mitigating the risk of XSS. This change will not alter the functionality of the code if the intention is to display the input value as plain text.

The specific change is to update line 190 to use .text() instead of .html(). No additional imports or dependencies are required for this fix.


Suggested changeset 1
apps/Core/Views/Default/html/system/tags/form.html

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/apps/Core/Views/Default/html/system/tags/form.html b/apps/Core/Views/Default/html/system/tags/form.html
--- a/apps/Core/Views/Default/html/system/tags/form.html
+++ b/apps/Core/Views/Default/html/system/tags/form.html
@@ -189,3 +189,3 @@
                 $('#{{componentId}}-{{sectionId}}-name').keyup(function(e) {
-                    $('#swatch-preview').html($('#{{componentId}}-{{sectionId}}-name').val());
+                    $('#swatch-preview').text($('#{{componentId}}-{{sectionId}}-name').val());
                 });
EOF
@@ -189,3 +189,3 @@
$('#{{componentId}}-{{sectionId}}-name').keyup(function(e) {
$('#swatch-preview').html($('#{{componentId}}-{{sectionId}}-name').val());
$('#swatch-preview').text($('#{{componentId}}-{{sectionId}}-name').val());
});
Copilot is powered by AI and may make mistakes. Always verify output.
@oyeaussie oyeaussie merged commit 91dcecd into main Jul 10, 2025
2 of 4 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