Skip to content

[Security] Redact cookies from debug logs#7531

Draft
gonzaloriestra wants to merge 1 commit into
mainfrom
sentinel/redact-cookies-3070110335838284999
Draft

[Security] Redact cookies from debug logs#7531
gonzaloriestra wants to merge 1 commit into
mainfrom
sentinel/redact-cookies-3070110335838284999

Conversation

@gonzaloriestra
Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

Session identifiers and other sensitive data stored in Cookie and Set-Cookie headers 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 cookie to the list of redacted keywords in sanitizedHeadersOutput. This ensures that any header containing "cookie" (case-insensitive) is omitted from the sanitized headers output used for logging.

How to test your changes?

  1. Enable debug logging.
  2. Run a command that makes an API request (e.g., shopify app info).
  3. Verify that any Cookie or Set-Cookie headers 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: gh tool was missing in environment, so I checked git log). No previous PRs were found that address cookie redaction in header sanitization.

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've considered analytics changes to measure impact
  • The change is user-facing — I've identified the correct bump type (patch) and added a changeset with pnpm 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

Add 'cookie' to the list of redacted keywords in `sanitizedHeadersOutput`
to prevent session data leakage in debug logs. Update tests to verify
redaction.
@google-labs-jules
Copy link
Copy Markdown

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@github-actions github-actions Bot added the no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. label May 12, 2026
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Potential Breaking Changes Detected

This PR contains changes that may break the existing contract.

@shopify/dev_experience — this PR contains breaking changes that require coordination for the next major release. This check will remain failed until a member of the team approves the workflow run.

💬 Head to #help-dev-platform to discuss timing and plan the release.

📦 Major Version Changesets

The following changesets request a major version bump:

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

@gonzaloriestra gonzaloriestra temporarily deployed to breaking-change-approval May 12, 2026 00:16 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. security

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant