fix(security): close credential persistence gaps - #232
Conversation
…f sensitive information' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8673582bf6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| r"(?i)(?<![a-z0-9_-])(?:access[-_]?token|auth[-_]?token|refresh[-_]?token|" | ||
| r"x[-_]?api[-_]?key|api[-_]?key|apikey|authorization|client[-_]?secret|" | ||
| r"credential|github[-_]?token|password|private[-_]?key|secret|token)" | ||
| r"\s*[:=]\s*[^\s,;}&\]]+" |
There was a problem hiding this comment.
Distinguish credential assignments from ordinary prose
In the control-center artifact path, ordinary operator text such as OAuth refresh token: expired or Estimate token: 5 now satisfies this expression. Because write_control_center_artifacts applies the detector to the final rendered Markdown and raises before any weekly or control-center write, a non-secret queue title, summary, or recommendation containing that wording suppresses all artifacts; constrain this check to serialized credential fields or credential-shaped values and cover benign prose.
AGENTS.md reference: src/AGENTS.md:L17-L19
Useful? React with 👍 / 👎.
| r"credential|github[-_]?token|password|private[-_]?key|secret|token)" | ||
| r"\s*[:=]\s*[^\s,;}&\]]+" | ||
| ) | ||
| _URL_WITH_USERINFO = re.compile(r"https?://[^/@\s]+@", re.IGNORECASE) |
There was a problem hiding this comment.
Restrict URL userinfo detection to the authority
For a valid URL whose query starts immediately after the host, such as https://example.com?email=user@example.com, this regex scans through the query and mistakes the email's @ for userinfo. The shared detector consequently rejects benign cache/artifact content, while the parallel CLI regex rewrites the URL as https://<redacted>@example.com; parse or bound the authority instead of matching until any @.
AGENTS.md reference: AGENTS.md:L65-L70
Useful? React with 👍 / 👎.
Summary
Security evidence
This follows up on current high CodeQL alerts 438, 440, 444, 445, 447, 456, and 457. Exact source-to-sink review found real shared-boundary gaps in cache persistence, CLI output, and final artifact rendering. The decision-digest and security-mode alerts project bounded aggregate values and remain unchanged.
The regression work was red-first across three passes, including URL userinfo, credential aliases, provider token families, private-key forms, URL fragments, and final rendered Markdown. An independent Luna review initially blocked publication on additional alias and fragment bypasses, then passed the corrected diff.
Verification
git diff --check: passedCodeQL/provider alert disposition remains subject to fresh PR analysis; this PR does not dismiss alerts or claim provider closure before that evidence exists.