Opened 7 years ago

Closed 7 years ago

#8471 closed defect (fixed)

AUTH COOKIEFILE parsing failure

Reported by: respice Owned by: atagar
Priority: Medium Milestone:
Component: Core Tor/Stem Version:
Severity: Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Windows 7, Parsed path containing escape characters is corrupted in response._parse_entry. Paths with
t are miss parsed because the code mistakes valid characters as escape characters. Failure occurs here:

if escaped:

for esc_sequence, replacement in CONTROL_ESCAPES.items():

next_entry = next_entry.replace(esc_sequence, replacement)

Child Tickets

Change History (5)

comment:1 Changed 7 years ago by atagar

Hi respice, thanks for the bug report! What and how tor escapes things is a little confused right now (for more on that see #4600).

Just to make sure, you're saying that '
t' is being misconverted to a tab, right? If so then I expect that tor's raw response is '

t' (since it should be escaping the slashes).

Could you please connect to your tor control port with telnet and provide the output of typing 'PROTOCOLINFO'?

Thanks! -Damian

comment:2 in reply to:  1 Changed 7 years ago by rransom

Replying to atagar:

Hi respice, thanks for the bug report! What and how tor escapes things is a little confused right now (for more on that see #4600).

This bug report is about Stem handling escapes in a completely broken way, not about Tor having different incompatible escaping conventions for input and output of quoted strings.

Just to make sure, you're saying that '
t' is being misconverted to a tab, right? If so then I expect that tor's raw response is '

t' (since it should be escaping the slashes).

Unlikely.

Depending on which hash function (and which key) Python is using, Stem will convert the sequence of characters “\\t” to either “\<tab>” or “<tab>”.

comment:3 Changed 7 years ago by atagar

This bug report is about Stem handling escapes in a completely broken way

Yes, I realize all that. Definitely a stem bug, though I'd still like to see the raw protocolinfo result though to make sure it's '

t'. :)

comment:4 Changed 7 years ago by respice

Yes, the
t sequence is replaced with a tab and the path is corrupted.

Here is the telnet output.

PROTOCOLINFO
250-PROTOCOLINFO 1
250-AUTH METHODS=COOKIE,SAFECOOKIE,HASHEDPASSWORD COOKIEFILE="C:
Users
Respice
AppData
Roaming
tor
control_auth_cookie"
250-VERSION Tor="0.2.3.25"
250 OK

Here it is from the debugger ...

Before stem escapement
"next_entry" str: C:

Users

Respice

AppData

Roaming

tor

control_auth_cookie

After stem escapement
"next_entry" str: C:
Users
Respice
AppData
Roaming
or
control_auth_cookie

Thanks for your great work!

comment:5 Changed 7 years ago by atagar

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.