fix: filter empty attribute values in Yivi disclosure session#72
Merged
rubenhensen merged 5 commits intomainfrom Mar 20, 2026
Merged
fix: filter empty attribute values in Yivi disclosure session#72rubenhensen merged 5 commits intomainfrom
rubenhensen merged 5 commits intomainfrom
Conversation
The hidden policy stored in the encrypted file header has empty string values for non-hint-type attributes (e.g. email becomes ""). Without filtering, these empty values would be forwarded to Yivi, causing it to require an empty attribute value — which no credential has. Filter out empty strings so that only non-empty values (i.e. values explicitly set by the frontend for public attributes) are enforced.
3 tasks
create_irma_session was incorrectly modified to reference variables not in its scope. Restore its original structure and apply the attribute value filtering in start where the request data is available.
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.
Summary
When decrypting an email using postguard website. We know the public sign, which is the email. We can thus force the yivi app to only show that specific attribute. This reduces the chance of decrypting with the wrong attribute.
""attr.value.clone()would forward this empty string to Yivi, causing it to require an attribute with an empty value — which no credential satisfies.filter(|v| !v.is_empty())so that only non-empty values are enforced in the Yivi session requestThe frontend (postguard-website) is responsible for reconstructing the actual email value (from the publicly known map key) before sending the key request to the PKG. This filter ensures that hint-type attributes with masked values (e.g.
"12345****") and hidden attributes with empty strings are treated as unconstrained (None) in Yivi.Test plan