[
  {
    "Id": "702837",
    "ThreadId": "280695",
    "Html": "<p>Hi,</p>\n<p><br />We have used Ionic.Zip.dll in our web application to Zip files before downloading. The assembly version&nbsp;of the dll is 1.8.4.27. The application is running in production. Recently our code has been scanned by veracode and identified various security issues. Some of the security issues are related to Ionic Zip dll. Can you please provide the justification on each of the security flaw identified.&nbsp;We need to submit a report providing justfication/resolution that in using Ionic Zip there is no security threat. Please find below table with the issues and description of the issues.</p>\n<table border=\"5\" cellspacing=\"0\" cellpadding=\"0\" width=\"1489\">\n<tbody>\n<tr>\n<td width=\"136\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">Category</span></p>\n</td>\n<td width=\"267\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">CWE Name</span></p>\n</td>\n<td width=\"429\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">Description</span></p>\n</td>\n<td width=\"80\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">Module</span></p>\n</td>\n<td width=\"260\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">Scope</span></p>\n</td>\n<td width=\"317\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">Function Prototype</span></p>\n</td>\n</tr>\n<tr>\n<td width=\"136\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">Cryptographic Issues</span></p>\n</td>\n<td width=\"267\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">Insufficient Entropy</span></p>\n</td>\n<td rowspan=\"4\" width=\"429\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">Standard random number generators do not provide a sufficient amount of entropy when used for security purposes. Attackers can brute force the output of pseudorandom number generators such as rand(). If this random number is used where security is a concern, such as generating a session key or session identifier, use a trusted cryptographic random number generator instead. These can be found on the Windows platform in the CryptoAPI or in an open source library such as OpenSSL. In Java, use the SecureRandom object to ensure sufficient entropy. References: CWE (http://cwe.mitre.org/data/definitions/331.html)</span></p>\n</td>\n<td width=\"80\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">Ionic.Zip.dll</span></p>\n</td>\n<td width=\"260\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">ionic_zip_dll.Ionic.Zip.SharedUtilities</span></p>\n</td>\n<td width=\"317\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">char GetOneRandomChar(int)</span></p>\n</td>\n</tr>\n<tr>\n<td width=\"136\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">Cryptographic Issues</span></p>\n</td>\n<td width=\"267\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">Insufficient Entropy</span></p>\n</td>\n<td width=\"80\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">Ionic.Zip.dll</span></p>\n</td>\n<td width=\"260\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">ionic_zip_dll.Ionic.Zip.SharedUtilities</span></p>\n</td>\n<td width=\"317\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">string GenerateRandomStringImpl(int, int)</span></p>\n</td>\n</tr>\n<tr>\n<td width=\"136\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">Cryptographic Issues</span></p>\n</td>\n<td width=\"267\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">Insufficient Entropy</span></p>\n</td>\n<td width=\"80\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">Ionic.Zip.dll</span></p>\n</td>\n<td width=\"260\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">ionic_zip_dll.Ionic.Zip.ZipEntry</span></p>\n</td>\n<td width=\"317\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">void _WriteSecurityMetadata(System.IO.Stream)</span></p>\n</td>\n</tr>\n<tr>\n<td width=\"136\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">Cryptographic Issues</span></p>\n</td>\n<td width=\"267\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">Insufficient Entropy</span></p>\n</td>\n<td width=\"80\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">Ionic.Zip.dll</span></p>\n</td>\n<td width=\"260\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">ionic_zip_dll.Ionic.Zip.WinZipAesCrypto</span></p>\n</td>\n<td width=\"317\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">WinZipAesCrypto Generate(string, int)</span></p>\n</td>\n</tr>\n<tr>\n<td width=\"136\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">Directory Traversal</span></p>\n</td>\n<td width=\"267\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">External Control of File Name or Path</span></p>\n</td>\n<td width=\"429\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">This call to mscorlib_dll.System.IO.File.Open() contains a path manipulation flaw. The argument to the function is a filename constructed using user-supplied input. If an attacker is allowed to specify all or part of the filename, it may be possible to gain unauthorized access to files on the server, including those outside the webroot, that would be normally be inaccessible to end users. The level of exposure depends on the effectiveness of input validation routines, if any. The first argument to Open() contains tainted data. The tainted data originated from an earlier call to ionic_zip_dll.Ionic.Zip.ZipFile.IsZipFile. Validate all user-supplied input to ensure that it conforms to the expected format, using centralized data validation routines when possible. When using black lists, be sure that the sanitizing routine performs a sufficient number of iterations to remove all instances of disallowed characters. References: CWE (http://cwe.mitre.org/data/definitions/73.html) WASC (http://webappsec.pbworks.com/Path-Traversal)</span></p>\n</td>\n<td width=\"80\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">Ionic.Zip.dll</span></p>\n</td>\n<td width=\"260\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">ionic_zip_dll.Ionic.Zip.ZipFile</span></p>\n</td>\n<td width=\"317\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">bool IsZipFile(string, bool)</span></p>\n</td>\n</tr>\n<tr>\n<td width=\"136\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">Directory Traversal</span></p>\n</td>\n<td width=\"267\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">External Control of File Name or Path</span></p>\n</td>\n<td rowspan=\"6\" width=\"429\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">This call to mscorlib_dll.System.IO.File.OpenRead() contains a path manipulation flaw. The argument to the function is a filename constructed using user-supplied input. If an attacker is allowed to specify all or part of the filename, it may be possible to gain unauthorized access to files on the server, including those outside the webroot, that would be normally be inaccessible to end users. The level of exposure depends on the effectiveness of input validation routines, if any. The first argument to OpenRead() contains tainted data. The tainted data originated from earlier calls to ionic_zip_dll.Ionic.Zip.ZipFile.Read, ionic_zip_dll.Ionic.Zip.ZipFile.CheckZip, and ionic_zip_dll.Ionic.Zip.ZipFile.FixZipDirectory. Validate all user-supplied input to ensure that it conforms to the expected format, using centralized data validation routines when possible. When using black lists, be sure that the sanitizing routine performs a sufficient number of iterations to remove all instances of disallowed characters. References: CWE (http://cwe.mitre.org/data/definitions/73.html) WASC (http://webappsec.pbworks.com/Path-Traversal)</span></p>\n</td>\n<td width=\"80\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">Ionic.Zip.dll</span></p>\n</td>\n<td width=\"260\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">ionic_zip_dll.Ionic.Zip.ZipFile</span></p>\n</td>\n<td width=\"317\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">System.IO.Stream get_ReadStream()</span></p>\n</td>\n</tr>\n<tr>\n<td width=\"136\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">Directory Traversal</span></p>\n</td>\n<td width=\"267\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">External Control of File Name or Path</span></p>\n</td>\n<td width=\"80\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">Ionic.Zip.dll</span></p>\n</td>\n<td width=\"260\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">ionic_zip_dll.Ionic.Zip.ZipFile</span></p>\n</td>\n<td width=\"317\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">System.IO.Stream get_WriteStream()</span></p>\n</td>\n</tr>\n<tr>\n<td width=\"136\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">Directory Traversal</span></p>\n</td>\n<td width=\"267\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">External Control of File Name or Path</span></p>\n</td>\n<td width=\"80\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">Ionic.Zip.dll</span></p>\n</td>\n<td width=\"260\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">ionic_zip_dll.Ionic.Zip.ZipFile</span></p>\n</td>\n<td width=\"317\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">void RemoveTempFile()</span></p>\n</td>\n</tr>\n<tr>\n<td width=\"136\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">Directory Traversal</span></p>\n</td>\n<td width=\"267\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">External Control of File Name or Path</span></p>\n</td>\n<td width=\"80\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">Ionic.Zip.dll</span></p>\n</td>\n<td width=\"260\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">ionic_zip_dll.Ionic.Zip.ZipFile</span></p>\n</td>\n<td width=\"317\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">void Save()</span></p>\n</td>\n</tr>\n<tr>\n<td width=\"136\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">Directory Traversal</span></p>\n</td>\n<td width=\"267\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">External Control of File Name or Path</span></p>\n</td>\n<td width=\"80\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">Ionic.Zip.dll</span></p>\n</td>\n<td width=\"260\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">ionic_zip_dll.Ionic.Zip.ZipFile</span></p>\n</td>\n<td width=\"317\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">void Save()</span></p>\n</td>\n</tr>\n<tr>\n<td width=\"136\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">Directory Traversal</span></p>\n</td>\n<td width=\"267\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">External Control of File Name or Path</span></p>\n</td>\n<td width=\"80\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">Ionic.Zip.dll</span></p>\n</td>\n<td width=\"260\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">ionic_zip_dll.Ionic.Zip.ZipFile</span></p>\n</td>\n<td width=\"317\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">void Save()</span></p>\n</td>\n</tr>\n<tr>\n<td width=\"136\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">Code Quality</span></p>\n</td>\n<td width=\"267\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">Improper Resource Shutdown or Release</span></p>\n</td>\n<td width=\"429\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">There are total of 9 instances. The program fails to release or incorrectly releases some variables, e.g. the variable ms, which was previously allocated by a call to mscorlib_dll.System.IO.MemoryStream.!newinit_0_0(). Ensure that all code paths properly release this resource. References: CWE (http://cwe.mitre.org/data/definitions/404.html)</span></p>\n</td>\n<td width=\"80\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">Ionic.Zip.dll</span></p>\n</td>\n<td width=\"260\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">ionic_zip_dll.Ionic.Zlib.DeflateStream</span></p>\n</td>\n<td width=\"317\" valign=\"bottom\">\n<p><span style=\"font-size: 9pt; color: black;\">byte[] CompressBuffer(byte[])</span></p>\n</td>\n</tr>\n</tbody>\n</table>\n<p>&nbsp;Thanks for the help in advance.</p>\n<p>&nbsp;</p>\n<p>Regards,&nbsp; Vashist</p>",
    "PostedDate": "2011-11-24T02:03:59.217-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]