]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix detection of point to insert signatures on a pending consensus.
authorNick Mathewson <nickm@torproject.org>
Wed, 3 Mar 2021 20:14:31 +0000 (15:14 -0500)
committerNick Mathewson <nickm@torproject.org>
Mon, 15 Mar 2021 12:56:58 +0000 (08:56 -0400)
We were looking for the first instance of "directory-signature "
when instead the correct behavior is to look for the first instance
of "directory-signature " at the start of a line.

Unfortunately, this can be exploited as to crash authorities while
they're voting.

Fixes #40316; bugfix on 0.2.2.4-alpha.  This is TROVE-2021-002,
also tracked as CVE-2021-28090.

changes/bug40316 [new file with mode: 0644]
src/feature/dirauth/dirvote.c

diff --git a/changes/bug40316 b/changes/bug40316
new file mode 100644 (file)
index 0000000..cd275b5
--- /dev/null
@@ -0,0 +1,5 @@
+  o Major bugfixes (security, denial of service):
+    - Fix a bug in appending detached signatures to a pending consensus
+      document that could be used to crash a directory authority.
+      Fixes bug 40316; bugfix on 0.2.2.6-alpha. Tracked as
+      TROVE-2021-002 and CVE-2021-28090.
index af8b3dc2078828d28520e90fe0c50606bd656a7d..9e01cee42a1314993c23138366f285c420d74a1c 100644 (file)
@@ -3520,7 +3520,7 @@ dirvote_add_signatures_to_pending_consensus(
       strlen(pc->body) + strlen(new_signatures) + 1;
     pc->body = tor_realloc(pc->body, new_consensus_len);
     dst_end = pc->body + new_consensus_len;
-    dst = strstr(pc->body, "directory-signature ");
+    dst = (char *) find_str_at_start_of_line(pc->body, "directory-signature ");
     tor_assert(dst);
     strlcpy(dst, new_signatures, dst_end-dst);