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

Missing repeated recipient detection #284

Open
mykhal opened this issue Jun 22, 2021 · 3 comments
Open

Missing repeated recipient detection #284

mykhal opened this issue Jun 22, 2021 · 3 comments
Labels

Comments

@mykhal
Copy link

mykhal commented Jun 22, 2021

Environment

  • OS: Linux
  • age version: 1.0.0-rc.3

What were you trying to do

Checking what happens if the same recipient pubkey is given multiple times (which can happen by mistake, when encrypting to multiple recipients).

What happened

No failure or warning. Resulting encrypted file is larger, containing unnecessary multiple master file key items for the same recipient in the header. (Also note that age happily encrypts empty file.)

$ r=age1recjpjentexampleeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeq7xc72d
$ age -o 1.age -r $r /dev/null
$ age -o 2.age -r $r -r $r /dev/null
$ age -o 3.age -r $r -r $r -r $r /dev/null
$ stat -c '%s %n' ?.age
200 1.age
298 2.age
396 3.age
@mykhal
Copy link
Author

mykhal commented Jun 25, 2021

In Python, I'd do at least set() on provided recipient list. Should not be serious memory issue even though number of recipient is theoretically unlimited now.

@neinseg
Copy link

neinseg commented Jul 25, 2021

While undocumented, for key types other than SSH-RSA repeating recipients does allow obscuring the total number of recipients in a way that is traceable by the recipients (as opposed to adding randomly generated keys and throwing away the private keys). Note that this is only the case iff age generates a new ephemeral secret for every stanza (as this go implementation does) and would not work if age used the same ephemeral secret across stanzas (as the spec allows).

I'm not sure that age should have that as a feature, but some people might find it useful and since it comes for free...

@FiloSottile FiloSottile added the CLI label Sep 4, 2021
@FiloSottile
Copy link
Owner

would not work if age used the same ephemeral secret across stanzas (as the spec allows)

The design document didn't specify it, but the v1 spec spells out that

A new ephemeral secret MUST be generated for each stanza and each file.

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

No branches or pull requests

3 participants