Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#6530 closed defect (fixed)

Out-of-bounds read in networkstatus_parse_vote_from_string()

Reported by: asn Owned by:
Priority: High Milestone: Tor: 0.2.2.x-final
Component: Core Tor/Tor Version:
Severity: Keywords: tor-relay
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


  tok = find_by_keyword(tokens, K_NETWORK_STATUS_VERSION);
  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",
      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 5 years ago by arma

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

comment:2 Changed 5 years ago by nickm

Status: newneeds_review

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

comment:3 Changed 5 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

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

comment:4 Changed 5 years ago by nickm

Keywords: tor-relay added

comment:5 Changed 5 years ago by nickm

Component: Tor RelayTor
Note: See TracTickets for help on using tickets.