fix _require_key_id leaking _key_id into JOSE payload - #84
Draft
toddr-bot wants to merge 1 commit into
Draft
Conversation
_require_key_id() mutated the caller's opts hash by assigning
$self->{_key_id} into $opts_hr->{_key_id}. In create_order(), this
caused the account key ID URL to be included in the newOrder JOSE
payload sent to the ACME server. The key ID already travels in the
JWS kid header — the payload copy was unintentional data leakage.
Simplified _require_key_id() to a pure validation check with no
hash argument. Added a test that intercepts the newOrder payload
and verifies _key_id is absent.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Stops
_require_key_id()from injecting_key_idinto the JOSE payload ofcreate_order()requests.Why
_require_key_id()mutated the caller's%optshash by setting$opts_hr->{'_key_id'} = $self->{'_key_id'}. Increate_order(), this caused the account key ID URL to be included in thenewOrderJOSE payload — e.g.{"_key_id":"https://acme.example.com/acct/12345","identifiers":[...]}. The key ID already travels in the JWSkidheader; the payload copy was unintentional data leakage.How
Simplified
_require_key_id()to a pure validation check: it reads$self->{'_key_id'}, dies if falsy, and returns — no hash argument, no mutation. Updated all three callers (create_order,change_key,deactivate_account) to call it without arguments.Testing
Added
t/Net-ACME2-create-order-payload.twhich intercepts thenewOrderJOSE payload via the mock server and asserts_key_idis absent. Full suite passes (382 tests).Quality Report
Changes: 3 files changed, 82 insertions(+), 6 deletions(-)
Code scan: clean
Tests: passed (OK)
Branch hygiene: clean
Generated by Kōan