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

terminate the GnuPG commandline #165

Merged
merged 1 commit into from
Jan 18, 2022
Merged

terminate the GnuPG commandline #165

merged 1 commit into from
Jan 18, 2022

Conversation

anarcat
Copy link
Contributor

@anarcat anarcat commented Jan 18, 2022

This is a safety measure to ensure that GnuPG may not be fed arbitrary
commandline arguments from the .gpg-id file. Normally, that file is
considered trusted, but it might be possible, in a multi-user
password-store, that it contains untrusted input from other users,
even if signed.

In that sense, it's technically possible for other users to add
arbitrary content in there, and therefore arbitrary commandline
arguments to GnuPG. There are two things that mitigate that possible
security issue already:

  1. each .gpg-id line is passed individually, in a list, so it will
    not get expanded by a shell, which also means only a single
    argument can be passed

  2. the --list-keys argument is already passed, so it is probably
    not possible to change the "mode" of GnuPG (say make it encrypt or
    sign content)

However, the GnuPG commandline interface being particularly
unscrutable, it seems safer to terminate the commandline using the
colloquial --.

This is copied from pass-audit, in:

roddhjav/pass-audit#28

... but the same audit was not performend on pass-import.

This is a safety measure to ensure that GnuPG may not be fed arbitrary
commandline arguments from the .gpg-id file. Normally, that file is
considered trusted, but it might be possible, in a multi-user
password-store, that it contains untrusted input from other users,
even if signed.

In that sense, it's technically possible for other users to add
arbitrary content in there, and therefore arbitrary commandline
arguments to GnuPG. There are two things that mitigate that possible
security issue already:

 1. each .gpg-id line is passed individually, in a list, so it will
    not get expanded by a shell, which also means only a single
    argument can be passed

 2. the --list-keys argument is already passed, so it is probably
    not possible to change the "mode" of GnuPG (say make it encrypt or
    sign content)

However, the GnuPG commandline interface being particularly
unscrutable, it seems safer to terminate the commandline using the
colloquial --.

This is copied from pass-audit, in:

roddhjav/pass-audit#28

... but the same audit was not performend on pass-import.
@roddhjav roddhjav merged commit 86992b1 into roddhjav:master Jan 18, 2022
@roddhjav
Copy link
Owner

Thank again for your work and your recommendation on this issue.

@anarcat anarcat deleted the fin branch January 19, 2022 16:14
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

Successfully merging this pull request may close these issues.

2 participants