[tor-bugs] #27367 [Core Tor/Tor]: Authorities and relays should reject non-UTF-8 in relay descriptors

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu Aug 30 02:36:24 UTC 2018


#27367: Authorities and relays should reject non-UTF-8 in relay descriptors
-------------------------------------------------+-------------------------
 Reporter:  teor                                 |          Owner:  (none)
     Type:  defect                               |         Status:
                                                 |  needs_revision
 Priority:  Medium                               |      Milestone:  Tor:
                                                 |  0.3.6.x-final
Component:  Core Tor/Tor                         |        Version:
 Severity:  Normal                               |     Resolution:
 Keywords:  rust-wants, prop285,                 |  Actual Points:
  034-triage-20180328, 034-removed-20180328      |
Parent ID:  #24033                               |         Points:
 Reviewer:                                       |        Sponsor:
-------------------------------------------------+-------------------------
Changes (by teor):

 * status:  needs_review => needs_revision


Comment:

 Thanks, I pushed it to CI, if it passes, a green tick will show up next to
 the branch on https://github.com/teor2345/tor/branches

 When we check different kinds of directory documents, we'll want the BOM
 check as part of a descriptor UTF-8 checking function in util_string.c.
 Would you mind moving it in this branch?

 Since the UTF-8 checking function accepts a length, we should probably
 also check for NUL. If we fail on the first NUL, this check becomes a
 last-ditch memory safety check, as most bytes in RAM are NUL.

 We should probably also log a bug warning if the function encounters a NUL
 byte:
 {{{
 if (BUG(failure-condition) {
   failure-action;
 }
 }}}
 or
 {{{
 if (success-condition) {
   return
 }
 tor_assert_nonfatal_unreached();
 }}}

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/27367#comment:7>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list