Commit 073d574a authored by Roger Dingledine's avatar Roger Dingledine
Browse files

Point out a potential DoS flaw in caching untrusted network

statuses to disk. We should resolve sometime.


svn:r6206
parent 415c9e87
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1974,7 +1974,7 @@ add_networkstatus_to_cache(const char *s,
#define NETWORKSTATUS_ALLOW_SKEW (24*60*60)
/** Given a string <b>s</b> containing a network status that we received at
 * <b>arrived_at</b> from <b>source</b>, try to parse it, see if we want to
 * store it, and put it into our cache is necessary.
 * store it, and put it into our cache as necessary.
 *
 * If <b>source</b> is NS_FROM_DIR or NS_FROM_CACHE, do not replace our
 * own networkstatus_t (if we're a directory server).
@@ -2065,6 +2065,10 @@ router_set_networkstatus(const char *s, time_t arrived_at,

  if (!trusted_dir) {
    if (!skewed && get_options()->DirPort) {
      /* XXX This is great as a first cut, but it looks like
       * any old person can give us an untrusted network-status and
       * we'll write it to disk as the newest one we have?
       * Also, there is no limit on the number that we'll store? -RD */
      add_networkstatus_to_cache(s, source, ns);
      networkstatus_free(ns);
    }