aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2006-03-21 05:27:35 +0000
committerRoger Dingledine <arma@torproject.org>2006-03-21 05:27:35 +0000
commit073d574a3f8527657cf581f4d78eaaacc77b6f15 (patch)
treed1faa62a872fd3774348a3db2f5bf459552d80cd /src
parent415c9e878ac4cbfc004cc859be1202c764b8fb10 (diff)
downloadtor-073d574a3f8527657cf581f4d78eaaacc77b6f15.tar
tor-073d574a3f8527657cf581f4d78eaaacc77b6f15.tar.gz
Point out a potential DoS flaw in caching untrusted network
statuses to disk. We should resolve sometime. svn:r6206
Diffstat (limited to 'src')
-rw-r--r--src/or/routerlist.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index e1ae70154..8cdb65884 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -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);
}