Our test program uses libgpgme to decrypt a file. We force it to core dump
after calling gpgme_data_release (which should delete the clear text password).
Upon inspection of the core we are able to recover the password which we
thought gpgme_data_release would prevent.
- Here is the encrypted file:
$ cat mumps.x
-----BEGIN PGP MESSAGE-----
Version: GnuPG v1.4.5 (GNU/Linux)
hQEMA0aWTbujSLQjAQf/Tihsg2LlCszvWWGWOWFdcWP3s78ExjpFGDhHYQNJ0wEq
04JTKUuXDRlbp45SWzHiG9iRZoFMh0lJvYSU6ILUgfOWb+J/DYhW+COmOxDF+LeG
VZeJDyRQr6esI3pYupuPvXPHxDf9gtQEbfPzsZrIgsPmGUXrkc+jnD4zzzAv9BId
OtMJeTDV8wwbClOL/OPyN8+LswzAFgU74oqXQhfocFS6Ipco+LXOmtCr7c7NmagJ
c3++qQKU7iExJAyO1/kIlS9YsWPDH4nf/5K26u3d2yKnGjzAFHPqEsXyj9dkySVW
8alQy+MzUkiW/ojpie7cgUxbSV2Q5d9pe8TveS9p+tJcAWHRdWU0pBW3P8tR86FS
xKPDvQT9M9VOZethMz/l0KtBq4jG+uR5Ej9ZUy/FV8ow2ELHfhMgv37o8VVk4/hm
CzJD4vHCU0b9d69MEXxhETt7LyXAntL9iAkHly0=
SlCZ
-----END PGP MESSAGE-----
- Here is the plain text
$ gpg -d mumps.x
You need a passphrase to unlock the secret key for
user: "Alice (Comment) <alice@bob.com>"
2048-bit RSA key, ID A348B423, created 2009-04-30 (main key ID 6414F131)
gpg: encrypted with 2048-bit RSA key, ID A348B423, created 2009-04-30
"Alice (Comment) <alice@bob.com>"
bacdefghijklmnopqrstuvwxyz123456
- Run a program that decrypts the file via libgpgme and properly calls
gpgme_data_release() (and crashes):
$ ./test_gpgme ß The password on the command line has been suppressed.
Quit (core dumped)
$ strings core.6178| grep bacdefghi
bacdefghijklmnopqrstuvwxyz123456 ß The clear text shows up in the core.
bacdefghijklmnopqrstuvwxyz123456
The affected platforms are:
OS (HW) -- libgpgme
Ubuntu 8.04 LTS (x86_64) -- 1.1.5-2
RHEL 5.2 (x86_64) -- 1.1.4
RHEL 4 .7 (x86) -- 1.0.3
RHEL 5 .3(IA64) -- 1.1.4
z/OS (zSeries) -- 1.1.8
AIX 5.3 (pSeries) -- 1.1.8 + fix
Solaris 9 and 10 (SPARC) -- 1.1.4
HP-UX 11.31 (IA64) -- 1.1.8 + fix