Skip to content

Commit 319a4bf

Browse files
committed
Concludes our Log Injection investigation
1 parent 3e1b3d7 commit 319a4bf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

msal/token_cache.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@ def add(self, event, now=None):
6969
if sensitive in event.get("data", {}):
7070
# Hide them from accidental exposure in logging
7171
event["data"][sensitive] = "********"
72-
logger.debug("event=%s", json.dumps(event, indent=4, sort_keys=True,
72+
logger.debug("event=%s", json.dumps(
73+
# We examined and concluded that this log won't have Log Injection risk,
74+
# because the event payload is already in JSON so CR/LF will be escaped.
75+
event, indent=4, sort_keys=True,
7376
default=str, # A workaround when assertion is in bytes in Python 3
7477
))
7578
response = event.get("response", {})

0 commit comments

Comments
 (0)