Changeset 49af13a


Ignore:
Timestamp:
Aug 13, 2008 3:59:16 PM (13 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
258d01f
Parents:
719ba3f
Message:
  • i2psnark: Fix OOM vulnerability by checking incoming message length (thanks devzero!)
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • apps/i2psnark/java/src/org/klomp/snark/PeerConnectionIn.java

    r719ba3f r49af13a  
    7878            // Wait till we hear something...
    7979            // The length of a complete message in bytes.
     80            // The biggest is the piece message, for which the length is the
     81            // request size (32K) plus 9. (we could also check if Storage.MAX_PIECES / 8
     82            // in the bitfield message is bigger but it's currently 5000/8 = 625 so don't bother)
    8083            int i = din.readInt();
    8184            lastRcvd = System.currentTimeMillis();
    82             if (i < 0)
     85            if (i < 0 || i > PeerState.PARTSIZE + 9)
    8386              throw new IOException("Unexpected length prefix: " + i);
    8487
  • apps/i2psnark/java/src/org/klomp/snark/PeerState.java

    r719ba3f r49af13a  
    6363  private final static int MAX_PIPELINE = 2;               // this is for outbound requests
    6464  private final static int MAX_PIPELINE_BYTES = 128*1024;  // this is for inbound requests
    65   private final static int PARTSIZE = 32*1024; // Snark was 16K, i2p-bt uses 64KB
     65  public final static int PARTSIZE = 32*1024; // Snark was 16K, i2p-bt uses 64KB
    6666  private final static int MAX_PARTSIZE = 64*1024; // Don't let anybody request more than this
    6767
  • history.txt

    r719ba3f r49af13a  
     12008-08-13 zzz
     2    * i2psnark: Fix OOM vulnerability by checking incoming message length
     3      (thanks devzero!)
     4
    152008-08-04 zzz
    26    * Floodfill Peer Selector:
  • router/java/src/net/i2p/router/RouterVersion.java

    r719ba3f r49af13a  
    1818    public final static String ID = "$Revision: 1.548 $ $Date: 2008-06-07 23:00:00 $";
    1919    public final static String VERSION = "0.6.2";
    20     public final static long BUILD = 11;
     20    public final static long BUILD = 12;
    2121    public static void main(String args[]) {
    2222        System.out.println("I2P Router version: " + VERSION + "-" + BUILD);
Note: See TracChangeset for help on using the changeset viewer.