Opened 21 months ago

Closed 21 months ago

Last modified 19 months ago

#6530 closed defect (fixed)

Out-of-bounds read in networkstatus_parse_vote_from_string()

Reported by: asn Owned by:
Priority: major Milestone: Tor: 0.2.2.x-final
Component: Tor Version:
Keywords: tor-relay Cc:
Actual Points: Parent ID:
Points:

Description

  tok = find_by_keyword(tokens, K_NETWORK_STATUS_VERSION);
  tor_assert(tok);
  if (tok->n_args > 1) {
    int flavor = networkstatus_parse_flavor_name(tok->args[1]);
    if (flavor < 0) {
      log_warn(LD_DIR, "Can't parse document with unknown flavor %s",
               escaped(tok->args[2]));
      goto err;
    }
    ns->flavor = flav = flavor;
  }

networkstatus_parse_vote_from_string() validates the second
argument of network-status-version which is the flavor of the
consensus. If the flavor is invalid it log_warn()s the third
argument which is not guaranteed to exist. This means that escaped() receives a non-allocated section of memory as its argument and treats it as a pointer to a string; this should lead to a segfault.

Child Tickets

Change History (5)

comment:1 Changed 21 months ago by arma

Looks like maint-0.2.2 is a good target for the fix.

comment:2 Changed 21 months ago by nickm

  • Status changed from new to needs_review

"bug6530" in my public repo should be good for merge into maint-0.2.2 and later.

comment:3 Changed 21 months ago by nickm

  • Resolution set to fixed
  • Status changed from needs_review to closed

okay; got a couple of reviews. merging to maint-0.2.2 and later. Authorities should probably start running this now.

comment:4 Changed 19 months ago by nickm

  • Keywords tor-relay added

comment:5 Changed 19 months ago by nickm

  • Component changed from Tor Relay to Tor
Note: See TracTickets for help on using tickets.