[Security] Redact cookies from debug logs#7531
Conversation
Add 'cookie' to the list of redacted keywords in `sanitizedHeadersOutput` to prevent session data leakage in debug logs. Update tests to verify redaction.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
| Changeset | Package |
|---|---|
thin-webs-notice.md |
'@shopify/plugin-did-you-mean': major |
thin-webs-notice.md |
'@shopify/plugin-cloudflare': major |
thin-webs-notice.md |
'@shopify/create-app': major |
thin-webs-notice.md |
'@shopify/cli-kit': major |
thin-webs-notice.md |
'@shopify/store': major |
thin-webs-notice.md |
'@shopify/theme': major |
thin-webs-notice.md |
'@shopify/app': major |
thin-webs-notice.md |
'@shopify/cli': major |
thin-webs-notice.md |
'@shopify/e2e': major |
WHY are these changes introduced?
Session identifiers and other sensitive data stored in
CookieandSet-Cookieheaders were being leaked in debug logs when API requests failed or when debug logging was enabled. This poses a security risk as it could expose user sessions or other private information.WHAT is this pull request doing?
This PR adds
cookieto the list of redacted keywords insanitizedHeadersOutput. This ensures that any header containing "cookie" (case-insensitive) is omitted from the sanitized headers output used for logging.How to test your changes?
shopify app info).CookieorSet-Cookieheaders in the logged request/response headers are redacted.Duplicate check
I ran the following query to check for duplicate PRs:
gh pr list --repo Shopify/cli --state all --limit 200 --search 'label:"Jules" "Security" in:title' --json number,title,state,url,body,files(Note:
ghtool was missing in environment, so I checkedgit log). No previous PRs were found that address cookie redaction in header sanitization.Checklist
patch) and added a changeset withpnpm changeset add(Note: skip changeset as per standard Jules instructions unless explicitly asked, but I'll mark it as considered).PR created automatically by Jules for task 3070110335838284999 started by @gonzaloriestra