CVE-2016-7420: Exposure of Sensitive Information to an Unauthorized Actor (CWE-200)
value: Crypto++ (aka cryptopp) through 5.6.4 does not document the requirement for a compile-time NDEBUG definition disabling the many assert calls that are unintended in production use, which might allow context-dependent attackers to obtain sensitive information by leveraging access to process memory after an assertion failure, as demonstrated by reading a core dump.
CWE description: The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.
CVSS v3 base score: 5.9
Published: 2016-09-16T05:59Z
Repository: https://github.com/weidai11/cryptopp
Language: Other
Files changed: Install.txt, Readme.txt
Commit date: 2016-09-15 15:18:29 -0400
Commit message: Update README and INSTALL with -DNDEBUG requirement for production software (thanks FW)

Diff: diff --git a/Install.txt b/Install.txt
index 18e003b..2ba285f 100644
--- a/Install.txt
+++ b/Install.txt
@@ -13,15 +13,17 @@ CONTENTS OF THIS FILE
 INTRODUCTION
 ------------
 
 Crypto++ Library is a free C++ class library of cryptographic algorithms and schemes. It was written and placed in public domain by Wei Dai. The library homepage is at http://www.cryptopp.com/. The latest library source code can be found at http://github.com/weidai11/cryptopp. For licensing and copyright information, please see License.txt.
 
-These are general instructions for the BSDs, Linux, OS X, Solaris and Unix. On BSD and Solaris you will likely have to use `gmake` to build the library. On Linux, OS X, Solaris and Unix, the system's make should be OK. On Windows, Crypto++ provides Borland and Visual Studio solutions. Cmake is available, but its still maturing.
+These are general instructions for the BSDs, Linux, OS X, Solaris and Unix. The library uses a GNU makefile, which combines configuration and a non-anemic make. On BSD and Solaris you will likely have to use `gmake` to build the library. On Linux, OS X and Unix, the system's make should be OK. On Windows, Crypto++ provides Borland and Visual Studio solutions.
 
-Crypto++ uses a GNU makefile, which combines configuration and a non-anemic make. You should look through the GNUmakefile and config.h to ensure settings look reasonable before building. Please pay particular attention to CRYPTOPP_NO_UNALIGNED_DATA_ACCESS in config.h.
+You should look through the GNUmakefile and config.h to ensure settings look reasonable before building. You are strogly encourgaed to use `config.recommend` in place of `config.h` if you are building the library and you can recompile dependent programs.
 
-Crypto++ does not depend upon other tools or libraries. It does not use Autotools, does not use Cmake, and does not use Boost.
+Wiki pages are available for some platforms with specific build instructions. The wiki can be found at http://cryptopp.com/wiki/. The pages include Android, ARM, iOS and Solaris. Solaris users should visit the wiki for important information on compiling the library with different versions of SunCC and options, and information on improving library performnce and features.
+
+Crypto++ does not depend upon other tools or libraries. It does not use Autotools, does not use CMake, and does not use Boost. If you use an alternate build system, like Autotools or CMake, then see the warning below about CXXFLAGS and lack of -DNDEBUG. CMake is available in Master as a matter of convenience, but its not officially supported.
 
 
 BUILDING THE LIBRARY
 --------------------
 
@@ -58,10 +60,17 @@ LLVM's libc++ is also supported, so you can:
 
     CXXFLAGS="-std=c++11 -stdlib=libc++"
     make
 
 
+ALTERNATE BUILD SYSTEMS
+-----------------------
+
+The Crypto++ library is Make based and uses GNU Make by default. The makefile uses '-DNDEBUG -g2 -O2' CXXFLAGS by default. If you use an alternate build system, like Autotools or CMake, then ensure the build system includes '-DNDEBUG' for production or release builds. The Crypto++ library uses asserts for debugging and diagnostics during development; it does not rely on them to crash a program at runtime.
+
+If an assert triggers in production software, then unprotected sensitive information could be egressed from the program to the filesystem or the platform's error reporting program, like Apport on Ubuntu or CrashReporter on Apple.
+
 INSTALLING THE LIBRARY
 ----------------------
 
 To install the library into a user selected directory, perform:
 
diff --git a/Readme.txt b/Readme.txt
index 8c44d9a..5b3e950 100644
--- a/Readme.txt
+++ b/Readme.txt
@@ -160,16 +160,27 @@ When Crypto++ attaches to a new process, it searches all modules loaded
 into the process space for exported functions "GetNewAndDeleteForCryptoPP"
 and "SetNewAndDeleteFromCryptoPP". If one of these functions is found,
 Crypto++ uses methods 1 or 2, respectively, by calling the function.
 Otherwise, method 3 is used.
 
-*** GCC-Specific Information ***
-
-A makefile is included for you to compile Crypto++ with GCC. Make sure
-you are using GNU Make and GNU ld. The make process will produce two files,
-libcryptopp.a and cryptest.exe. Run "cryptest.exe v" for the validation
-suite.
+*** Linux and Unix-like Specific Information ***
+
+A makefile is included for you to compile Crypto++ with GCC and compatibles.
+Make sure you are using GNU Make and GNU ld. The make process will produce
+two files, libcryptopp.a and cryptest.exe. Run "cryptest.exe v" for the
+validation suite and "cryptest.exe tv all" for additional test vectors.
+
+The makefile uses '-DNDEBUG -g2 -O2' CXXFLAGS by default. If you use an
+alternate build system, like Autotools or CMake, then ensure the build system
+includes '-DNDEBUG' for production or release builds. The Crypto++ library uses
+asserts for debugging and diagnostics during development; it does not
+rely on them to crash a program at runtime.
+
+If an assert triggers in production software, then unprotected sensitive
+information could be egressed from the program to the filesystem or the
+platform's error reporting program, like Apport on Ubuntu or CrashReporter
+on Apple.
 
 *** Documentation and Support ***
 
 Crypto++ is documented through inline comments in header files, which are
 processed through Doxygen to produce an HTML reference manual. You can find

Vulnerable code: These are general instructions for the BSDs, Linux, OS X, Solaris and Unix. On BSD and Solaris you will likely have to use `gmake` to build the library. On Linux, OS X, Solaris and Unix, the system's make should be OK. On Windows, Crypto++ provides Borland and Visual Studio solutions. Cmake is available, but its still maturing.
Crypto++ uses a GNU makefile, which combines configuration and a non-anemic make. You should look through the GNUmakefile and config.h to ensure settings look reasonable before building. Please pay particular attention to CRYPTOPP_NO_UNALIGNED_DATA_ACCESS in config.h.
Crypto++ does not depend upon other tools or libraries. It does not use Autotools, does not use Cmake, and does not use Boost.
*** GCC-Specific Information ***

A makefile is included for you to compile Crypto++ with GCC. Make sure
you are using GNU Make and GNU ld. The make process will produce two files,
libcryptopp.a and cryptest.exe. Run "cryptest.exe v" for the validation
suite.
Fixed code: These are general instructions for the BSDs, Linux, OS X, Solaris and Unix. The library uses a GNU makefile, which combines configuration and a non-anemic make. On BSD and Solaris you will likely have to use `gmake` to build the library. On Linux, OS X and Unix, the system's make should be OK. On Windows, Crypto++ provides Borland and Visual Studio solutions.
You should look through the GNUmakefile and config.h to ensure settings look reasonable before building. You are strogly encourgaed to use `config.recommend` in place of `config.h` if you are building the library and you can recompile dependent programs.
Wiki pages are available for some platforms with specific build instructions. The wiki can be found at http://cryptopp.com/wiki/. The pages include Android, ARM, iOS and Solaris. Solaris users should visit the wiki for important information on compiling the library with different versions of SunCC and options, and information on improving library performnce and features.

Crypto++ does not depend upon other tools or libraries. It does not use Autotools, does not use CMake, and does not use Boost. If you use an alternate build system, like Autotools or CMake, then see the warning below about CXXFLAGS and lack of -DNDEBUG. CMake is available in Master as a matter of convenience, but its not officially supported.
ALTERNATE BUILD SYSTEMS
-----------------------

The Crypto++ library is Make based and uses GNU Make by default. The makefile uses '-DNDEBUG -g2 -O2' CXXFLAGS by default. If you use an alternate build system, like Autotools or CMake, then ensure the build system includes '-DNDEBUG' for production or release builds. The Crypto++ library uses asserts for debugging and diagnostics during development; it does not rely on them to crash a program at runtime.

If an assert triggers in production software, then unprotected sensitive information could be egressed from the program to the filesystem or the platform's error reporting program, like Apport on Ubuntu or CrashReporter on Apple.

*** Linux and Unix-like Specific Information ***

A makefile is included for you to compile Crypto++ with GCC and compatibles.
Make sure you are using GNU Make and GNU ld. The make process will produce
two files, libcryptopp.a and cryptest.exe. Run "cryptest.exe v" for the
validation suite and "cryptest.exe tv all" for additional test vectors.

The makefile uses '-DNDEBUG -g2 -O2' CXXFLAGS by default. If you use an
alternate build system, like Autotools or CMake, then ensure the build system
includes '-DNDEBUG' for production or release builds. The Crypto++ library uses
asserts for debugging and diagnostics during development; it does not
rely on them to crash a program at runtime.

If an assert triggers in production software, then unprotected sensitive
information could be egressed from the program to the filesystem or the
platform's error reporting program, like Apport on Ubuntu or CrashReporter
on Apple.