sha174n commented on code in PR #44496:
URL: https://github.com/apache/superset/pull/44496#discussion_r4065531987


##########
superset/sql/execution/executor.py:
##########
@@ -604,6 +604,19 @@ def _check_security(self, script: SQLScript, schema: str | 
None = None) -> None:
                 )
             )
 
+        # Rejected regardless of `allow_dml`: these do host file I/O, not DML.
+        if file_transfer_commands := 
script.get_client_file_transfer_commands():
+            raise SupersetSecurityException(
+                SupersetError(
+                    message=(
+                        "SQL statement contains disallowed client-side "
+                        f"file-transfer command(s): {file_transfer_commands}"

Review Comment:
   Fixed in bc23bd4, both this call site and the sql_lab exception now render 
`', '.join(sorted(...))`.



##########
superset/sql/parse.py:
##########
@@ -1371,6 +1395,15 @@ def is_mutating(self) -> bool:
 
         return False
 
+    def get_client_file_transfer_command(self) -> str | None:
+        """
+        Return the client-side file-transfer command head, if this is one.
+
+        :return: The uppercased command head (e.g. ``"PUT"``), else ``None``.
+        """
+        head = self._command_head()

Review Comment:
   Good catch, confirmed on the pinned sqlglot. Fixed in bc23bd4: structured 
`exp.Put`/`exp.Get` nodes are now matched via an explicit node-to-head mapping, 
with quoted-path cases added to the parse and executor tests.



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