github-advanced-security[bot] commented on code in PR #7940:
URL: https://github.com/apache/geode/pull/7940#discussion_r2432692997


##########
geode-pulse/src/main/webapp/scripts/pulsescript/common.js:
##########
@@ -79,9 +151,19 @@
       if ($(this).is("div")) {
         $(this).html(escapeHTML(customDisplayValue));
       } else if ($(this).is("img")) {
-        $(this).attr('src', customDisplayValue);
+        // Security: Validate image src to prevent XSS via javascript: URLs
+        if (customDisplayValue && 
!customDisplayValue.match(/^(https?:\/\/|\/|data:image\/)/i)) {
+          console.warn("Potentially unsafe image src blocked:", 
customDisplayValue);
+        } else {
+          $(this).attr('src', customDisplayValue);

Review Comment:
   ## DOM text reinterpreted as HTML
   
   [DOM text](1) is reinterpreted as HTML without escaping meta-characters.
   
   [Show more 
details](https://github.com/apache/geode/security/code-scanning/123)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to