Page MenuHome GnuPG

[GPGEX] Setting plaintext packet to invalid filename (-&12) will cause 3rdparty application misbehaviour
Closed, InvalidPublic

Description

Files encrypted with gpgex set the PLAINTEXT packet to a ??temporary?? file
descriptor. When you decrypt the file with gpg itself and status fd you see the
following:

[GNUPG:] PLAINTEXT 62 1268210582 -&12

notice "-&12". It has been established by 3rd party clients like PGP Desktop,
Universal and other Gateways - to use the PLAINTEXT packet information as the
original filename instead of the one currently attached to an e-mail.

What happends when this message wents through a decryption application is, that
it gets automatically renamed from myfile.pgp to -&12

The Plaintext packet is used to reveal the original unencrypted filename,
because some 3rd party application use this extension to obfuscate the original
file. I.e. when i encrypt file.doc it becomes <somerandomstring>.pgp - the
information that the original file was file.doc is stored in the plaintext
packet. When you now attach this file, encrypted with GPGEX to an e-mail message

  • the misbehaviour with other 3rdparty applications occur.

Two Solutions:

Either do not set the plaintext packet at all
OR
Set the filename correctly (im guessing gpgex is using command line gpg and
piping the input?) in this case - use the original filename as a parameter for
--encrypt instead of the temporary filename/descriptor.

Event Timeline

werner lowered the priority of this task from Unbreak Now! to Normal.Mar 12 2010, 6:03 PM
werner added a subscriber: werner.

This is not a gpgex bug but one of GPA or Kleopatra. They set the filename to
be included.

The specific filename is not very useful (it is the internal description of a
file descriptor). The filename encoded in the package should not be used because
it is entirely under the control of the sender and may thus be used to to trick
the receiver into overwriting a local file. Using it for documentation might be
okay.

werner removed a project: Bug Report.

BTW, what version of GPA or Kleopatra are you using?

Meanwhile I commited a fix to not encode these special filenames.

Meanwhile I commited a fix to not encode these special filenames.

you mean, that there is no longer a

[GNUPG:] PLAINTEXT 62 1268210582 -&12

output?

BTW, what version of GPA or Kleopatra are you using?

sorry, i only received that kinda of file and cannot provide more information apart
from viewing the mail headers and seeing it was gpgex

Obviously not. If someone uses such a filename, it will of course be shown.

Obviously not. If someone uses such a filename, it will of course be shown.

but that someone is your application, either gpgex or another middle layer
which is using file descriptors instead of real names - and gnupg is setting
this even tho a filedescriptor has been supplied instead of a real filename

so, if it is a file descriptor - the better idea would be NOT to set a
plaintext packet

As said, I already implemented this. See T1201 (wk on Mar 12 2010, 06:17 PM / Roundup).