Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Trac Trac
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Service Desk
    • Milestones
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • Legacy
  • TracTrac
  • Issues
  • #16410

Closed (moved)
(moved)
Open
Created Jun 21, 2015 by Trac@tracbot

No maximum length for variable-length cells.

There does not seem to be any maximum length used when pulling variable-length cells from a connection buffer. The relevant code in fetch_var_cell_from_buf() in buffers.c:

length = ntohs(get_uint16(hdr + circ_id_len + 1));
if (buf->datalen < (size_t)(header_len+length))
  return 1;
result = var_cell_new(length);
result->command = command;
if (wide_circ_ids)
  result->circ_id = ntohl(get_uint32(hdr));
else
  result->circ_id = ntohs(get_uint16(hdr));                                 

buf_remove_from_front(buf, header_len);
peek_from_buf((char*) result->payload, length, buf);
buf_remove_from_front(buf, length);

I don't see anywhere in tor-spec where a variable-length max length is defined, but it seems like there should be some sort of explicit length cap (e.g. a malicious client/relay wanting to be annoying could force constant 64KB allocations).

I brought this up in irc, and it was mentioned a variable-length length cap would have to be sufficiently large and future proof, and I'm not sure what that value that would be.

It's not clear to me whether or not its intentional to allow 64KB variable-length cells.

Trac:
Username: nsk

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking