Skip to content

Add optional ID-JAG encryption with JWE#102

Open
mcguinness wants to merge 2 commits into
mainfrom
jwe-support
Open

Add optional ID-JAG encryption with JWE#102
mcguinness wants to merge 2 commits into
mainfrom
jwe-support

Conversation

@mcguinness

Copy link
Copy Markdown
Collaborator

Summary

Adds an optional ## Encrypted ID-JAG mechanism that lets an IdP Authorization Server JWE-encrypt the ID-JAG to its target Resource Authorization Server, mirroring how OpenID Connect ID Tokens can be encrypted.

Motivation

The claims an End-User has consented to release to a Client during SSO are not necessarily the same as the claims the IdP Authorization Server is permitted to release to the audience of an ID-JAG. An ID-JAG may carry sensitive attributes (email, phone_number, sub_id, audience-scoped enterprise identifiers, etc.) that the Client should not be able to read but that the Resource Authorization Server needs for subject resolution and policy. Encryption preserves this distinction by ensuring only the RAS can decrypt the JWS.

What's in the PR

  • New section ## Encrypted ID-JAG {#id-jag-encryption} under # Identity Assertion JWT Authorization Grant defining the JWE structure (outer header MUST carry alg, enc, cty: JWT, kid; SHOULD carry typ: oauth-id-jag+jwt), sign-then-encrypt as REQUIRED, IdP-side issuer processing, RAS-side consumer processing, and a non-normative example.
  • IdP Authorization Server Metadata: id_jag_encryption_alg_values_supported and id_jag_encryption_enc_values_supported to advertise capability, with negotiation rule (intersection with RAS values).
  • Resource Authorization Server Metadata: same parameter names used as a request (when paired with a use: enc key in jwks_uri), plus id_jag_encryption_required for deployments that mandate encryption.
  • Access Token Request Processing Rules: new decrypt-first bullet so the existing typ/aud/client_id/signature checks all run against the inner JWS.
  • DPoP cnf self-check reconciliation: the client SHOULD only inspect the ID-JAG for cnf when it is not encrypted. Explicit note that this is a loss of a client-side diagnostic, not a weakening of PoP, since the RAS still enforces cnf after decryption.
  • Security Considerations: extended ## Subject Identifier Disclosure to point at encryption as the mitigation when downstream-required identifiers cannot be omitted, plus a new ## Claim Confidentiality {#id-jag-claim-confidentiality} consideration.
  • Normative references: RFC 7516 (JWE), RFC 7517 (JWK), RFC 7518 (JWA).
  • IANA: registers the three new metadata parameters in the OAuth Authorization Server Metadata registry.

Test plan

  • Render with kramdown-rfc / xml2rfc and confirm cross-references resolve ({{id-jag-encryption}}, {{ras-metadata}}, {{token-request}}, {{id-jag-claim-confidentiality}}).
  • Confirm the non-normative example renders correctly as preformatted text.
  • Confirm RFC 7516, 7517, 7518 references resolve in the bibliography.
  • Confirm no existing anchors changed.

Adds an Encrypted ID-JAG subsection to the Identity Assertion JWT
Authorization Grant section that defines how an IdP Authorization
Server MAY encrypt an ID-JAG to its target Resource Authorization
Server using JWE. The motivation is to convey claims that are
sensitive or contain personal information (for example email,
phone_number, sub_id, or audience-scoped enterprise identifiers) to
the Resource Authorization Server without disclosing them to the
Client that presents the ID-JAG, since the claims released to the
Client during SSO are not necessarily the same as those released to
the ID-JAG audience.

Sign-then-encrypt is REQUIRED. The encrypted ID-JAG is a Nested JWT
with the outer JWE protected header carrying alg, enc, cty=JWT, and
kid, and the inner JWS keeping typ=oauth-id-jag+jwt. The RAS decrypts
first and applies all existing processing rules to the inner JWS.

Adds metadata parameters for capability advertisement and
negotiation: id_jag_encryption_alg_values_supported and
id_jag_encryption_enc_values_supported on both the IdP (as
capability) and the RAS (as a request, when paired with an
enc-marked JWK in the RAS jwks_uri), plus id_jag_encryption_required
on the RAS for deployments that mandate encryption.

Reconciles client-opacity points raised by the change: the DPoP cnf
self-inspection diagnostic now SHOULD only be performed when the
ID-JAG is not encrypted, with explicit text that the loss is a
client-side diagnostic, not a weakening of proof-of-possession,
since the RAS still enforces cnf after decryption.

Adds a Claim Confidentiality Security Consideration and extends the
Subject Identifier Disclosure consideration to point to encryption
as the mitigation when downstream-required identifiers cannot be
omitted. Adds normative references to RFC 7516 (JWE), RFC 7517
(JWK), and RFC 7518 (JWA). Registers the three new metadata
parameters in the OAuth Authorization Server Metadata registry.
- The outer JWE protected header MUST include:

- `alg`: the key management algorithm, registered in the "JSON Web Signature and Encryption Algorithms" registry {{RFC7518}}, that the IdP Authorization Server used to wrap the content encryption key. The IdP MUST select a value supported by the target Resource Authorization Server.
- `enc`: the content encryption algorithm, registered in the "JSON Web Signature and Encryption Algorithms" registry {{RFC7518}}, that the IdP Authorization Server used to encrypt the JWS plaintext. The IdP MUST select a value supported by the target Resource Authorization Server.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requiring enc is incompatible with JOSE HPKE https://datatracker.ietf.org/doc/html/draft-ietf-jose-hpke-encrypt-20 where only alg is present for the Integrated Encryption mode.

Address PR feedback that requiring the JWE enc header is incompatible
with the Integrated Encryption mode defined in draft-ietf-jose-hpke-
encrypt, where alg MUST be present and enc MUST NOT be present.

Loosens the JWE Structure section so that enc is required only when
the chosen alg uses a separate content encryption algorithm (Key
Encryption mode and similar), and prohibited when the chosen alg is
an Integrated Encryption mode such as the HPKE algorithms. Updates
the IdP issuer processing rules, the IdP-side and RAS-side metadata
descriptions for id_jag_encryption_enc_values_supported (now MAY be
omitted when only Integrated Encryption modes are supported), and
the algorithm negotiation rule (alg first, then enc only if the
chosen alg requires it). Drops the implicit "key wrap" framing in
the kid and alg descriptions so that Direct and Integrated modes are
not excluded.

Adds draft-ietf-jose-hpke-encrypt as an informative reference and
points to it as the canonical example of an Integrated Encryption
mode that prohibits enc.
@mcguinness

Copy link
Copy Markdown
Collaborator Author

Good catch, thanks. Pushed 878ae99 to address this.

The fix loosens the JWE header rules so that enc is required only when the chosen alg uses a separate content encryption algorithm (the JWE Key Encryption mode case), and prohibited when the chosen alg is an Integrated Encryption mode such as the HPKE algorithms defined in draft-ietf-jose-hpke-encrypt.

Specifically:

  • JWE Structure: alg, cty, kid stay MUST. enc is now scoped to "MUST be present when the chosen alg is a Key Encryption mode (or other mode that uses a separate content encryption algorithm)" and "MUST NOT be present when the chosen alg is an Integrated Encryption mode that prohibits enc, for example the HPKE Integrated Encryption algorithms."
  • IdP issuer processing step 2: encrypts using one of the advertised alg values, and selects an enc value only when the chosen alg requires one. Otherwise omits enc.
  • Negotiation rule: pick alg from the intersection first, then enc from the corresponding intersection only when the chosen alg requires it.
  • Metadata: id_jag_encryption_enc_values_supported MAY be omitted (on both the IdP and RAS sides) when only Integrated Encryption modes are supported. id_jag_encryption_alg_values_supported + a use: enc JWK in the JWK Set is now the standalone signal to encrypt.
  • Dropped the "key wrap" framing in the alg and kid descriptions so that Direct Encryption and Integrated modes aren't implicitly excluded.

Added draft-ietf-jose-hpke-encrypt as an informative reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants