bito-code-review[bot] commented on code in PR #40653:
URL: https://github.com/apache/superset/pull/40653#discussion_r3345008379
##########
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:
<!-- Bito Reply -->
The removal of the duplicate sanitization function and the adoption of the
shared utility from the error sanitization module is the correct approach. This
change effectively eliminates the divergence risk and ensures a single source
of truth for log sanitization, as recommended.
--
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]