Opened 11 months ago

Last modified 10 months ago

#22697 new enhancement

Tor should mandatory require brackets around ipv6 address

Reported by: toralf Owned by:
Priority: Medium Milestone: Tor: unspecified
Component: Core Tor/Tor Version: Tor: 0.3.1.3-alpha
Severity: Normal Keywords: tor-client tor-relay parsing ipv6 compatibility-issues
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Stem and Tor do differ about validating an ipv6 address :

ValueError: '2a00:1450:4001:0058::7/16' isn't a wildcard, IPv4, or IPv6 address: reject6 2a00:1450:4001:0058::7/16:443

The same term is accepted by Tor (within torrc).

maybe Tor should be more strict too ?

A short talk with atagar on IRC yielded into this bug report.

Child Tickets

Change History (5)

comment:1 Changed 11 months ago by atagar

Just a little more context...

10:18 < atagar> toralf: If this is in a descriptor then yes, the square brackets are mandatory (https://gitweb.torproject.org/torspec.git/tree/dir-spec.txt#n1244). If it's in the torrc then it's unspecified. Tor lacks a spec for what it'll accept but all its examples have square brackets (https://www.torproject.org/docs/tor-manual.html.en#ExitPolicy).

10:21 < atagar> I'd very much favor saying tor should require square brackets as it does with the spec. Otherwise your example (reject6 2a00:1450:4001:0058::7/16:443) is a pita to parse since the '/16' is optional, so that means I'd also need to make sense of '2a00:1450:4001:0058::7:443'.

comment:2 Changed 11 months ago by dgoulet

Milestone: Tor: unspecified

comment:3 in reply to:  1 Changed 11 months ago by teor

Replying to atagar:

10:21 < atagar> I'd very much favor saying tor should require square brackets as it does with the spec. Otherwise your example (reject6 2a00:1450:4001:0058::7/16:443) is a pita to parse since the '/16' is optional, so that means I'd also need to make sense of '2a00:1450:4001:0058::7:443'.

This would break existing torrcs: but we should at least make the brackets mandatory when there is a port and no mask.

comment:4 Changed 11 months ago by atagar

Could we have tor issue a warning and eventually make it mandatory? I'm wary of weird behavior that lingers on forever due only to historical reasons.

Last edited 11 months ago by atagar (previous) (diff)

comment:5 Changed 10 months ago by nickm

Keywords: tor-client tor-relay parsing ipv6 compatibility-issues added

I'm okay with making this more consistent, but if we do, we should try very hard to avoid breaking backward compatibility, and we should make sure that warning messages are logical and comprehensible.

Note: See TracTickets for help on using tickets.