Repository navigation
Reject empty or oversized RP IDs in the setMinPINLength parameters - #807
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request introduces a maximum length validation of 253 bytes for RP IDs within SetMinPinLengthParams to prevent storing excessively large serialized values, accompanied by new unit tests. Feedback suggests optimizing this validation by performing the length check inside the mapping closure during parsing, which avoids unnecessary heap allocations and improves efficiency in memory-constrained environments.
08c7cbf to
e5cbbda
Compare
|
The length check moved into the mapping closure: the request now fails with |
|
This is somewhat inconsistent with #805. There we introduce I think the changes here generally make sense. We might want to merge them into #805. Or we merge that, and then import and reuse the constant. |
e5cbbda to
d6ad057
Compare
|
Thanks for the review! I aligned this PR with #805:
Happy to fold these changes into #805 if that is easier for you. Otherwise, once #805 lands I will rebase this PR and import the constant from there instead of redefining it. |
d6ad057 to
f1f9182
Compare
The minPinLengthRPIDs entries are defined as fully qualified domain names, which RFC 1035 limits to 253 bytes in presentation format. Empty or longer strings are currently accepted while parsing and only rejected later, when storing the list fails because the serialized value exceeds the maximum value size of the persistent store, after the token permissions were already checked. Reject such entries while parsing, matching the checks that MakeCredential performs on its RP ID.
f1f9182 to
2d4d728
Compare
The
minPinLengthRPIDsentries are defined as fully qualified domain names, which RFC 1035 limits to 253 bytes in presentation format.Longer strings are currently accepted while parsing and only rejected later, when storing the list fails because the serialized value exceeds the maximum value size of the persistent store, after the token permissions were already checked.
Reject such entries when parsing the parameters, so the request fails with
CTAP1_ERR_INVALID_PARAMETERbefore anything else runs.