rusackas commented on code in PR #40653:
URL: https://github.com/apache/superset/pull/40653#discussion_r3345007902


##########
superset/mcp_service/auth.py:
##########
@@ -77,6 +77,96 @@ class MCPNoAuthSourceError(ValueError):
     """
 
 
+def _sanitize_iss_for_log(value: Any) -> str:
+    """Escape control characters in an issuer claim before logging.
+
+    The ``iss`` claim is attacker-controlled and may contain newlines that
+    could forge or split log lines; collapse them to keep one log entry.
+    """
+    return (
+        str(value)
+        .replace("\\", "\\\\")
+        .replace("\n", "\\n")
+        .replace("\r", "\\r")
+        .replace("\t", "\\t")
+    )

Review Comment:
   Done — removed the duplicate `_sanitize_iss_for_log` from `auth.py` and 
replaced it with the shared `sanitize_for_log` from 
`superset/mcp_service/utils/error_sanitization.py` (the same helper 
`jwt_verifier.py` already imports), so there is a single source of truth and no 
divergence risk.



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