Skip to content

Cleanup more claim paths - #801

Open
nodh wants to merge 6 commits into
feature/json-path-removalfrom
feature/claim-paths
Open

nodh wants to merge 6 commits into
feature/json-path-removalfrom
feature/claim-paths

Conversation

@nodh

@nodh nodh commented Nov 13, 2026

Copy link
Copy Markdown
Member

Some more fixes to our internal claim path structure and handling, to prepare for a refactoring.

@nodh nodh added this to the 10.0 milestone Nov 13, 2026
@nodh
nodh requested a review from JesusMcCloud November 13, 2026 09:08
@nodh
nodh added this pull request to stack #797 November 13, 2026 09:08
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T08:59:57.203073Z 7a3eec2 Manual request
🔒 Security Review ✅ Completed 2026-11-13T09:14:21.794963Z cc6e8aa PR opened

Security findings

Advisory findings (1)

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛡️ Codex Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: cc6e8aaac5

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment on lines +64 to 65
// presented as a whole, its claims are not selectively disclosable (OpenID4VP 1.0, 6.4.1)
CreatePresentationResult.VcJws(credential.vcSerialized)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛡️ Codex Security Review · Automatically triggered

P1 Badge Security: Reject filtered requests for non-selective VCs

When a wallet holds a PLAIN_JWT with claims beyond the accepted DCQL filter, this branch now serializes the complete stored credential despite the matching result identifying only requested claims. The removed guard previously rejected this case. Consequently, an accepted but overreaching verifier can request a benign claim and receive every claim in the signed VC, bypassing the consent flow documented as showing the matches before finalization. Keep rejecting filtered queries unless consent explicitly covers disclosure of the complete credential.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

sounds serious to me

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cc6e8aaac5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +190 to +193
val alreadyQualified = firstSegment is OpenId4VciClaimsPathPointerSegmentString &&
firstSegment.string == VcDataModelConstants.CREDENTIAL_SUBJECT
return if (alreadyQualified) this
else copy(path = OpenId4VciClaimsPathPointer(VcDataModelConstants.CREDENTIAL_SUBJECT) + path)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve already-rooted VC claim descriptions

When a VC-JWT scheme—particularly an ExtractedVcJwtCredentialScheme built from type metadata—already supplies a root-level path such as ["issuer"] or ["type"], this unconditionally rewrites it to ["credentialSubject", "issuer"] or ["credentialSubject", "type"]. Claims path pointers apply to the credential root (OpenID4VCI Appendix C), so the rewritten issuer metadata advertises nonexistent claims, and a mandatory root claim makes CredentialScheme.requiredClaims reject otherwise valid credentials. Preserve explicitly qualified VC-root paths, for example with a qualification flag analogous to isoClaimPathsAreQualified, while still qualifying subject-relative paths for shared multi-format schemes.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

sounds equally serious

Comment on lines +84 to +85
val namespaces = (requestedMdocClaims + requestedOptionalMdocClaims)
.groupBy({ it.namespace }, { SingleItemsRequest(dataElementIdentifier = it.claimName, intentToRetain = false) })

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep optional mdoc attributes from blocking credential matches

When optionalAttributePaths contains an element that a holder's mdoc does not contain, adding it to the DocRequest here makes the otherwise suitable credential fail matching. DeviceRetrievalProcedure.evaluateItemsRequestAgainstCredential explicitly requires every entry in ItemsRequest.namespaces and throws for a missing element, so the response path never reaches the claimed missing-element error handling; the wallet instead reports no matching credential even when every required attribute is present. Either omit optional attributes from direct ISO requests or extend the matching and response pipeline to represent absent requested elements without rejecting the credential.

Useful? React with 👍 / 👎.

@JesusMcCloud JesusMcCloud left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ping me, if this is not reviewed by Thursday 10 a.m.

@nodh nodh self-assigned this Nov 17, 2026
@nodh
nodh force-pushed the feature/claim-paths branch from cc6e8aa to 7a3eec2 Compare November 18, 2026 08:56
@nodh

nodh commented Nov 18, 2026

Copy link
Copy Markdown
Member Author

@codex review again

@nodh
nodh requested a review from JesusMcCloud November 18, 2026 08:57
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 7a3eec2d1d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@nodh
nodh force-pushed the feature/claim-paths branch 2 times, most recently from d4c4fed to 7f9ccf2 Compare November 18, 2026 10:10
nodh and others added 6 commits November 19, 2026 10:56
Cite the RFC 9901 steps each check implements, distinguish a disclosure
supplied twice (4) from a digest occurring twice (7.1 step 4), and cite
never-disclosable claims to draft-ietf-oauth-sd-jwt-vc-19, 2.2.2.3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The OpenID4VP 7.3 example tests and the serialization conformance tests
of DCQLClaimsPathPointer cover the same behavior.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ISO/IEC 18013-5 requests a data element by its name space and data
element identifier (2021, 8.3.2.1.2.1). RequestOptionsCredential
interpreted the claims path pointers of an ISO_MDOC request twice:
toDocRequest() ignored pointers with three or more names and the
optional ones, while the DCQL builder threw on the former and put a
lone identifier into the name space "mdoc" when the scheme had none.

RequestOptionsCredential now reads them once, when constructed, as
requestedMdocClaims and requestedOptionalMdocClaims, rejecting any
other shape, and both builders use only those. toDocRequest() still
requests only the required data elements, as a DocRequest marks none
as optional (8.3.2.1.2.1). toIsoMdocClaimPath and toSingleItemsRequest
are removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
WRPRC authorization exempted only the root vct claim. Exempt every
claim that draft-ietf-oauth-sd-jwt-vc-19, 2.2.2.3 forbids to be
selectively disclosed (iss, nbf, exp, cnf, vct, vct#integrity,
aka_vcts, status), including their sub-claims, since the holder can
not withhold them. sub, iat, and nested claims of these names must
still be registered. Share the claim set with SdJwtEvaluation.

As the exemption relies on the holder not withholding sub-claims,
processDisclosures rejects a disclosure anywhere below these claims,
as an object property or an array element, not only of the claims
themselves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DCQL claims paths for W3C VCs match on the root of the VC (OpenID4VP
1.0, B.1.2), e.g. ["credentialSubject", "given_name"], instead of on a
flattened credential subject:

- CredentialToJsonConverter returns the VC itself for VC-JWTs
- CredentialPresentationRequestBuilder prefixes credentialSubject to
  VC-JWT attribute paths (toVcJwtClaimPath)
- Required claims of VC-JWT types are qualified the same way
  (vcJwtQualifiedClaimDescriptions), unless the scheme's paths start
  at the VC root already (vcJwtClaimPathsAreQualified), as for schemes
  derived from type metadata, so they may name e.g. ["issuer"]
- A VC-JWT is presented as a whole also if claims are requested, since
  its claims are not selectively disclosable (OpenID4VP 1.0, 6.4.1).
  DCQLCredentialQuery.match reports it as AllClaimsMatchingResult, so a
  wallet asking for consent shows that every claim is disclosed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claims paths point into the VC (OpenID4VCI 1.0, C), so jwt_vc_json
credential configurations advertise ["credentialSubject", "given_name"]
instead of ["given_name"].

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nodh
nodh force-pushed the feature/claim-paths branch from 7f9ccf2 to 6ceefa9 Compare November 19, 2026 09:58

This branch has not been deployed

No deployments
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