Skip to content

transit: warn when context is ignored on non-derived keys - #32076

Open
SashaMIT wants to merge 1 commit into
hashicorp:mainfrom
SashaMIT:fix/transit-warn-unused-encrypt-context
Open

transit: warn when context is ignored on non-derived keys#32076
SashaMIT wants to merge 1 commit into
hashicorp:mainfrom
SashaMIT:fix/transit-warn-unused-encrypt-context

Conversation

@SashaMIT

@SashaMIT SashaMIT commented Aug 8, 2026

Copy link
Copy Markdown

Description

Transit encrypt / decrypt accept a context parameter even when the key has derivation disabled. GetKey then takes the non-derived fast path and silently ignores that context, so operators can believe they have per-context isolation while ciphertext still decrypts without (or with a different) context.

This PR emits a response warning when context is supplied on a non-derived key for encrypt/decrypt. Cryptographic behavior is unchanged (still ignore context; no hard fail), so existing clients keep working while the warning makes the footgun visible.

TODO only if you're a HashiCorp employee

  • Backport Labels: If this fix needs to be backported, use the appropriate backport/ label that matches the desired release branch.
    • LTS: If this fixes a critical security vulnerability or severity 1 bug, it will also need to be backported to the current LTS versions of Vault. To ensure this, use all available enterprise labels.
  • Jira: If this change has an associated Jira, it's referenced either in the PR description, commit message, or branch name.
  • RFC: If this change has an associated RFC, please link it in the description.

PCI review checklist

  • I have documented a clear reason for, and description of, the change I am making.
  • If applicable, I've documented a plan to revert these changes if they require more than reverting the pull request.
  • If applicable, I've documented the impact of any changes to security controls.

Examples of changes to security controls include using new access control methods, adding or removing logging pipelines, etc.

Revert: Revert this PR; no migration or data change.
Security-control impact: Adds an operator-visible warning only. No new authz path, no change to encrypt/decrypt success criteria, no logging pipeline change.

encrypt/decrypt accept context even when the key has derivation
disabled, then silently ignore it via GetKey's non-derived fast path.
Operators can believe they have per-context isolation while ciphertext
decrypts without context. Emit a response warning; behavior unchanged.

Signed-off-by: Sasha Mitchell <sash.t.mitchell@gmail.com>
@vercel

vercel Bot commented Aug 8, 2026

Copy link
Copy Markdown

Deployment failed for project vault-ui with the following error:

The `vercel.json` schema validation failed with the following message: should NOT have additional property `public`

Learn More: https://vercel.com/docs/concepts/projects/project-configuration

@vercel

vercel Bot commented Aug 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
vault-ui Error Error Aug 8, 2026 12:34pm

Request Review

@SashaMIT

SashaMIT commented Aug 8, 2026

Copy link
Copy Markdown
Author

Closing to reopen as non-draft; GitHub denied markReadyForReview for this fork PR.

@SashaMIT SashaMIT closed this Aug 8, 2026
@SashaMIT SashaMIT reopened this Aug 8, 2026
@SashaMIT
SashaMIT marked this pull request as ready for review August 8, 2026 12:41
@SashaMIT
SashaMIT requested a review from a team as a code owner August 8, 2026 12:41
@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. secret/transit labels Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

secret/transit size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant