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

infinite loop for particular command line arguments #158

Open
invd opened this issue Apr 24, 2020 · 0 comments
Open

infinite loop for particular command line arguments #158

invd opened this issue Apr 24, 2020 · 0 comments

Comments

@invd
Copy link

invd commented Apr 24, 2020

The optind--; operations in ykpers-args.c can lead to infinite loops.
This happens if ykpersonalize is invoked with -a or -c command line parameters that are directly followed by another - character.
The argument parsing via getopt() will then repeatedly loop over the same argument.

As briefly discussed with @nevun, this may be inconvenient during practical use if typos in the parameter spacing happen, but I see no apparent security impact.

The issue was found during fuzzing.

Relevant code:


Issue examples:

ykpersonalize -a-

This prints debug info about the Yubikey and then runs with 100% CPU usage (1 thread).

ykpersonalize -c-

This endlessly asks for Access code, 6 bytes (12 characters hex) : and otherwise idles.

Precondition: a Yubikey is present.
Version: this was tested with v1.19.3 and v1.20.0 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant