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

[PUK] Is it a security issue or normal PIV spec #67

Closed
rayanboulares opened this issue Aug 14, 2022 · 2 comments
Closed

[PUK] Is it a security issue or normal PIV spec #67

rayanboulares opened this issue Aug 14, 2022 · 2 comments

Comments

@rayanboulares
Copy link

rayanboulares commented Aug 14, 2022

After issuing a first command for PIN change using PUK, we can then issue other requests with wrong PUKs and it will still change PIN.

Reproduce steps (with default values of PUK=12345678 and PIN=123456) :

APDU#1
00 2C 00 80 31 32 33 34 35 36 37 38 31 31 31 31 31 31 FF FF
90 00

==> PIN is now 111111

APDU#2
00 2C 00 80 FF FF FF FF FF FF FF FF 32 32 32 32 32 32 FF FF
90 00

==> PIN is now 222222 even with wrong PUK sent

If we disconnect and reconnect the card then APDU#2 won't change PIN.

@dengert
Copy link

dengert commented Aug 17, 2022

Not being much of a Java programmer, it looks like:
https://github.com/arekinath/PivApplet/blob/master/src/net/cooperi/pivapplet/PivApplet.java#L2554
should not be done, so pukpin.check is done for every processResetPin

@arekinath
Copy link
Owner

Yeah that's a mistake -- it should revalidate it every time and not cache state. It should also be returning SW 6983 if it's already blocked at the start of the command.

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

No branches or pull requests

3 participants