github-advanced-security[bot] commented on code in PR #38409:
URL: https://github.com/apache/superset/pull/38409#discussion_r2894943699


##########
superset/mcp_service/dashboard/tool/add_chart_to_existing_dashboard.py:
##########
@@ -63,35 +63,107 @@
     return row_key
 
 
-def _find_tab_insert_target(layout: Dict[str, Any]) -> str | None:
+def _normalize_tab_text(text: str) -> str:
+    """Strip emoji and extra whitespace from tab text for flexible matching."""
+    import re
+
+    # Remove emoji characters (Unicode emoji ranges)
+    # Note: using regular strings (not raw) so Python processes \U escapes
+    cleaned = re.sub(
+        "[\U0001f300-\U0001f9ff\U00002600-\U000027bf\U0000fe00-\U0000fe0f"

Review Comment:
   ## Overly permissive regular expression range
   
   Suspicious character range that overlaps with \ufffd-\ufffd in the same 
character class.
   
   [Show more 
details](https://github.com/apache/superset/security/code-scanning/2251)



##########
superset/mcp_service/dashboard/tool/add_chart_to_existing_dashboard.py:
##########
@@ -63,35 +63,107 @@
     return row_key
 
 
-def _find_tab_insert_target(layout: Dict[str, Any]) -> str | None:
+def _normalize_tab_text(text: str) -> str:
+    """Strip emoji and extra whitespace from tab text for flexible matching."""
+    import re
+
+    # Remove emoji characters (Unicode emoji ranges)
+    # Note: using regular strings (not raw) so Python processes \U escapes
+    cleaned = re.sub(
+        "[\U0001f300-\U0001f9ff\U00002600-\U000027bf\U0000fe00-\U0000fe0f"

Review Comment:
   ## Overly permissive regular expression range
   
   Suspicious character range that overlaps with \ufffd-\ufffd in the same 
character class.
   
   [Show more 
details](https://github.com/apache/superset/security/code-scanning/2253)



##########
superset/mcp_service/dashboard/tool/add_chart_to_existing_dashboard.py:
##########
@@ -63,35 +63,107 @@
     return row_key
 
 
-def _find_tab_insert_target(layout: Dict[str, Any]) -> str | None:
+def _normalize_tab_text(text: str) -> str:
+    """Strip emoji and extra whitespace from tab text for flexible matching."""
+    import re
+
+    # Remove emoji characters (Unicode emoji ranges)
+    # Note: using regular strings (not raw) so Python processes \U escapes
+    cleaned = re.sub(
+        "[\U0001f300-\U0001f9ff\U00002600-\U000027bf\U0000fe00-\U0000fe0f"

Review Comment:
   ## Overly permissive regular expression range
   
   Suspicious character range that overlaps with \u2702-\u27b0 in the same 
character class.
   
   [Show more 
details](https://github.com/apache/superset/security/code-scanning/2252)



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to