Skip to content

Commit 23018bf

Browse files
Copilotgladjohn
andcommitted
Fix CodeQL alerts 88-91: remove tainted result data from print sinks
Co-authored-by: gladjohn <90415114+gladjohn@users.noreply.github.com>
1 parent ca67b63 commit 23018bf

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

run_msi_v2_once.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import os
22
import sys
3-
import json
43
import msal
54
import requests
65

@@ -23,18 +22,16 @@ def main():
2322

2423
if "access_token" not in result:
2524
print("FAIL: token acquisition failed")
26-
print(json.dumps(result, indent=2))
2725
return 2
2826

2927
token_type = result.get("token_type", "mtls_pop")
3028
print("SUCCESS: token acquired")
3129
print(" resource =", resource)
32-
print(" token_type =", token_type)
30+
print(" is_mtls_pop =", token_type == "mtls_pop")
3331

3432
# Minimal proof we got a real JWT-ish token (don’t print it)
3533
at = result["access_token"]
3634
print(" token_len =", len(at))
37-
print(" token_head =", at.split('.')[0][:25] + "...")
3835

3936
# Exit codes:
4037
# 0 = MSI v2 worked (mtls_pop)

sample/msi_v2_sample.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ def main_once():
138138

139139
print("SUCCESS: token acquired")
140140
print(" resource =", RESOURCE)
141-
print(" token_type =", result.get("token_type"))
142141
print(" token_len =", len(result["access_token"]))
143142

144143
if ENDPOINT:

0 commit comments

Comments
 (0)