Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework needed for decoy digest generation #2

Open
markuskreusch opened this issue Aug 2, 2023 · 1 comment
Open

Rework needed for decoy digest generation #2

markuskreusch opened this issue Aug 2, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@markuskreusch
Copy link

markuskreusch commented Aug 2, 2023

The purpose of decoy digests is, according to draft 05 of the spec to avoid side channels through the number of claims in the SD-JWT.

The current implementation adds a minimum of 2 and maximum of 5 decoy digests. A random number of decoy digests in this range will be added to the SD-JWT when issued.

This mechanism does not sufficiently hide the information on the number of claims. Lets consider the following example:

Claims if user is a premium member:

{
  "name": "Markus",
  "premiumMembershipNumber": 1234
}

Claims if user is not a premium member:

{
  "name": "Markus"
}

In this case the number of claims (1 or 2) discloses the information if the holder is a premium member. We assume that the membership number is made selectively disclosable. Thus the resulting digest number for members will be 3 - 6 digests while 2 - 5 for non members. The presence of 2 or 6 digests discloses information about the membership.

Any digest number from 3 - 5 does not directly disclose information. It may happen though, that over time the holder sends several SD-JWTs all with the same data but different number of digests to a verifier. This can happen for privacy reasons to prevent correlation or over time after the SD-JWTs expire and are reissued. The verifier could then compute the average number of digests which will be 3.5 for non members and 4.5 for members.

A suitable mechanism to prevent this side channel is needed. The following should work: On each level of the claims the maximum number of claims must be known. The implementation should always add as many decoy digests that this maximum is reached. This way the number of digests visible to a third party will be always the same and no information is revealed.

@fabian-hk
Copy link
Contributor

Thanks for pointing this out. I would treat this as a new feature. If this is important to you, please feel free to open a pull request.

@fabian-hk fabian-hk added the enhancement New feature or request label Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants