Summary
A pinUvAuthToken retains all requested permissions after a successful
user-presence-gated makeCredential or getAssertion operation.
CTAP 2.1 requires clearing all token permissions except lbw after an
operation tests user presence. As a result, a token containing
mc|ga|acfg can perform a touch-gated registration and then immediately
use authenticatorConfig with acfg without another touch.
Details
FidoState::mark_token_used() at crates/rsk-fido/src/state.rs:359
only refreshes last_used_ms; it does not clear permissions.
It is called during token validation from:
makecredential.rs:451
getassertion.rs:362
The actual presence checks happen later in the successful operation paths.
After those checks, the implementation does not apply the equivalent of
clearPinUvAuthTokenPermissionsExceptLbw().
authenticatorConfig accepts the remaining acfg permission without a
presence check for regular subcommands such as toggleAlwaysUv and
enableEnterpriseAttestation.
CTAP 2.1 reference:
https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#pinuvauthprotocol-clearpinuvauthtokenpermissionsexceptlbw
PoC
Prerequisites:
- A device with a configured PIN.
- A valid protocol-two pinUvAuthToken obtained with permissions
mc|ga|acfg (0x23).
- A valid
pinUvAuthParam for the requested operation.
- Obtain the multi-permission token.
- Send
authenticatorMakeCredential with the token and up implicitly
true.
- Complete the requested physical presence check.
- Reuse the same token to send
authenticatorConfig with
toggleAlwaysUv or enableEnterpriseAttestation.
- The configuration command succeeds without another physical presence
check.
Expected behavior: after step 3, the token permissions are reduced to
lbw (or zero if lbw was not requested), and step 4 fails with
CTAP2_ERR_PIN_AUTH_INVALID.
Impact
A host that holds a valid multi-permission token can carry an
acfg authorization across a user-presence-gated FIDO operation and
modify security-relevant authenticator configuration without the
additional presence boundary required by CTAP 2.1.
This is not unauthenticated: obtaining the token still requires the
appropriate PIN/UV authorization.
AUT_ENABLE and AUT_DISABLE have their own touch checks, so the
no-second-touch impact specifically applies to regular configuration
subcommands such as toggleAlwaysUv and enableEnterpriseAttestation.
Suggested fix: after the successful UP check, retain only:
ctx.state.paut.permissions &= PERM_LBW;
For getAssertion, use the raw up request value; for makeCredential,
UP is implicitly true. The mask should be applied after the successful
presence check, not immediately after mark_token_used().
Summary
A pinUvAuthToken retains all requested permissions after a successful
user-presence-gated makeCredential or getAssertion operation.
CTAP 2.1 requires clearing all token permissions except
lbwafter anoperation tests user presence. As a result, a token containing
mc|ga|acfgcan perform a touch-gated registration and then immediatelyuse
authenticatorConfigwithacfgwithout another touch.Details
FidoState::mark_token_used()atcrates/rsk-fido/src/state.rs:359only refreshes
last_used_ms; it does not clear permissions.It is called during token validation from:
makecredential.rs:451getassertion.rs:362The actual presence checks happen later in the successful operation paths.
After those checks, the implementation does not apply the equivalent of
clearPinUvAuthTokenPermissionsExceptLbw().authenticatorConfigaccepts the remainingacfgpermission without apresence check for regular subcommands such as
toggleAlwaysUvandenableEnterpriseAttestation.CTAP 2.1 reference:
https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#pinuvauthprotocol-clearpinuvauthtokenpermissionsexceptlbw
PoC
Prerequisites:
mc|ga|acfg(0x23).pinUvAuthParamfor the requested operation.authenticatorMakeCredentialwith the token andupimplicitlytrue.
authenticatorConfigwithtoggleAlwaysUvorenableEnterpriseAttestation.check.
Expected behavior: after step 3, the token permissions are reduced to
lbw(or zero iflbwwas not requested), and step 4 fails withCTAP2_ERR_PIN_AUTH_INVALID.Impact
A host that holds a valid multi-permission token can carry an
acfgauthorization across a user-presence-gated FIDO operation andmodify security-relevant authenticator configuration without the
additional presence boundary required by CTAP 2.1.
This is not unauthenticated: obtaining the token still requires the
appropriate PIN/UV authorization.
AUT_ENABLEandAUT_DISABLEhave their own touch checks, so theno-second-touch impact specifically applies to regular configuration
subcommands such as
toggleAlwaysUvandenableEnterpriseAttestation.Suggested fix: after the successful UP check, retain only:
For
getAssertion, use the rawuprequest value; formakeCredential,UP is implicitly true. The mask should be applied after the successful
presence check, not immediately after
mark_token_used().