Opened 23 months ago

Last modified 21 months ago

#22123 assigned enhancement

baseXX API strictness

Reported by: catalyst Owned by: catalyst
Priority: Medium Milestone: Tor: unspecified
Component: Core Tor/Tor Version:
Severity: Normal Keywords: technical-debt refactor api
Cc: Actual Points:
Parent ID: #19531 Points:
Reviewer: Sponsor:

Description

We should think about how strict to make decoders for our baseXX APIs. In some situations, it improves security to only have a single canonical encoding for any particular value. We should see where this is true in our code.

Base16

  • case sensitivity (currently case-insensitive)

Base32

  • case sensitivity (currently case-insensitive -- also the standard default is uppercase and we use lowercase)
  • padding strictness (currently no padding at all, even with odd lengths?)
  • trailing bits strictness (in an odd-length decode, there might be leftover bits in the final non-padding character. for a canonical encoding, they should all be zero)

Base64

  • padding strictness
    • padding = characters only at end (currently any padding characters terminate decoding)
    • correct number of padding characters (currently not checked)
  • whitespace? (maybe only if explicitly allowed?) currently we allow any whitespace
  • trailing bits strictness (in an odd-length decode, there might be leftover bits in the final non-padding character. for a canonical encoding, they should all be zero)

Child Tickets

Change History (2)

comment:1 Changed 23 months ago by catalyst

Milestone: Tor: unspecified
Owner: set to catalyst
Status: newassigned

comment:2 Changed 21 months ago by nickm

Keywords: technical-debt refactor api added
Note: See TracTickets for help on using tickets.