Vulnerability Note VU#403051

GnuPG format string vulnerability in do_get() in ttyio.c while prompting for a new filename

Original Release date: 10 Dec 2001 | Last revised: 05 Nov 2003

Overview

There is a format string vulnerability in GNU Privacy Guard. By sending a GPG message with a carefully crafted malicious filename, an attacker may be able to execute arbitrary code as the user who decrypts the message.

Description

GNU Privacy Guard (GPG) is a free, RFC2440 compliant replacement for Pretty Good Privacy (PGP).

A format string vulnerability occurs in the do_get() function in ttyio.c, where GnuPG calls tty_printf() with a user supplied format string. When GPG encounters a filename with an unknown suffix, and it is not in batch mode, it prompts the user for a new filename to write the decrypted results to. The default value (which is included in the prompt) is the existing filename. Note that the filename is embedded in the encrypted message itself, and that safe file names selected by the recipient is not sufficient to protect against this attack. If the filename embedded in the message contains printf style format characters, the message creator may be able to execute arbitrary code as the user who decrypts the message.

Impact

An attacker may be able to execute arbitrary code as the user decrypting the message.

Solution

Apply a patch from your vendor

GNU Privacy Guard version 1.0.6 corrects this problem. Many vendors have published security advisories and released updated distributions correcting the vulnerability.

Decrypt files in batch mode

Because the vulnerable code is not called when GnuPG is in batch mode, users may be able to work around the vulnerability by specifying --batch on the command line.

Systems Affected (Learn More)

VendorStatusDate NotifiedDate Updated
ConectivaAffected-12 Dec 2001
DebianAffected10 Dec 200111 Dec 2001
FreeBSDAffected10 Dec 200111 Dec 2001
Guardian Digital Inc. Affected-05 Nov 2003
ImmunixAffected-10 Dec 2001
MandrakeSoftAffected10 Dec 200111 Dec 2001
Red Hat Inc.Affected10 Dec 200111 Dec 2001
SuSE Inc.Affected-10 Dec 2001
The SCO Group (SCO Linux)Affected10 Dec 200111 Dec 2001
TrustixAffected-10 Dec 2001
TurboLinuxAffected-05 Nov 2003
FujitsuNot Affected10 Dec 200105 Nov 2003
OpenBSDNot Affected10 Dec 200105 Nov 2003
Apple Computer Inc.Unknown10 Dec 200111 Dec 2001
BSDIUnknown10 Dec 200111 Dec 2001
If you are a vendor and your product is affected, let us know.View More »

CVSS Metrics (Learn More)

Group Score Vector
Base N/A N/A
Temporal N/A N/A
Environmental N/A N/A

References

Credit

Thanks to Fish Stiqz for discovering this vulnerability.

This document was written by Cory F. Cohen.

Other Information

  • CVE IDs: CVE-2001-0522
  • Date Public: 29 May 2001
  • Date First Published: 10 Dec 2001
  • Date Last Updated: 05 Nov 2003
  • Severity Metric: 21.94
  • Document Revision: 9

Feedback

If you have feedback, comments, or additional information about this vulnerability, please send us email.