fix(security): unify secret redaction in public comment outputs (#1693)

Ensure all public issue, PR, and inline comments apply redactSecrets() in addition to sanitizeContent() before submitting payloads to the GitHub API. This aligns public comment output with error log and step-summary redaction policies, preventing potential leakage of Anthropic API keys, AWS credentials, Slack tokens, JWTs, and GitHub tokens.
This commit is contained in:
Juwan
2026-08-18 17:23:11 -07:00
committed by GitHub
parent d40ddef4c0
commit 54eadc2f72
5 changed files with 96 additions and 6 deletions
+2 -2
View File
@@ -6,7 +6,7 @@ import { z } from "zod";
import { GITHUB_API_URL } from "../github/api/config";
import { Octokit } from "@octokit/rest";
import { updateClaudeComment } from "../github/operations/comments/update-claude-comment";
import { sanitizeContent } from "../github/utils/sanitizer";
import { redactSecrets, sanitizeContent } from "../github/utils/sanitizer";
// Get repository information from environment variables
const REPO_OWNER = process.env.REPO_OWNER;
@@ -55,7 +55,7 @@ server.tool(
const isPullRequestReviewComment =
eventName === "pull_request_review_comment";
const sanitizedBody = sanitizeContent(body);
const sanitizedBody = redactSecrets(sanitizeContent(body));
const result = await updateClaudeComment(octokit, {
owner,