Skip to content

Commit 93a486d

Browse files
committed
fix(security): don't read the OAuth secret value in the orchestration debug printer (aws-samples#247 PR aws-samples#373 CodeQL high)
CodeQL flagged py/clear-text-logging-sensitive-data (HIGH) at scripts/orchestration_debug.py:53 — the parent-meta printer derived has_oauth via m.get('linear_oauth_secret_arn'), which READS the secret ARN value (CodeQL's taint source) even though only 'yes'/'no' is printed. The secret never actually reached output, but the value-read started the taint. Fix: test KEY PRESENCE ('linear_oauth_secret_arn' in m) so the secret string is never accessed at all — no taint source, and the printed line provably logs only the parent issue id, repo, user id, and a presence flag. Debug-only script (DynamoDB pretty-printer), not prod code. Resolves the 1 high-severity CodeQL alert on PR aws-samples#373.
1 parent 533316c commit 93a486d

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

scripts/orchestration_debug.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,16 @@ def main():
4848

4949
for m in meta:
5050
n = m.get("child_count", {}).get("N", "?")
51-
has_oauth = "yes" if m.get("linear_oauth_secret_arn") else "no"
52-
print(f" PARENT issue={s(m, 'parent_linear_issue_id')} repo={s(m, 'repo')} children={n}")
53-
print(f" release_ctx: user={s(m, 'platform_user_id')} oauth={has_oauth}")
51+
# Never print the OAuth secret ARN/value — only WHETHER one is present.
52+
# Test KEY PRESENCE (``in``) rather than reading the value with
53+
# ``.get(...)``: the secret ARN string is never accessed, so it can't be
54+
# logged and CodeQL's clear-text-logging-of-secrets taint never starts.
55+
has_oauth = "yes" if "linear_oauth_secret_arn" in m else "no"
56+
parent_issue = s(m, "parent_linear_issue_id")
57+
repo = s(m, "repo")
58+
user = s(m, "platform_user_id")
59+
print(f" PARENT issue={parent_issue} repo={repo} children={n}")
60+
print(f" release_ctx: user={user} oauth={has_oauth}")
5461

5562
for k in sorted(kids, key=lambda i: s(i, "linear_identifier")):
5663
st = s(k, "child_status")

0 commit comments

Comments
 (0)