[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #12930 [Pluggable transport]: Someone, somewhere needs to unescape pluggable transport "SMETHOD ARGS" arguments.
#12930: Someone, somewhere needs to unescape pluggable transport "SMETHOD ARGS"
arguments.
-------------------------------------+-----------------
Reporter: yawning | Owner: asn
Type: defect | Status: new
Priority: normal | Milestone:
Component: Pluggable transport | Version:
Resolution: | Keywords:
Actual Points: | Parent ID:
Points: |
-------------------------------------+-----------------
Comment (by dcf):
Replying to [comment:1 yawning]:
> There's also a goptlib bug here, where it escapes twice. Once in
`encodeSmethodArgs()` (fine), and once in `pt.go:formatline()` (not so
fine).
>
> If the output was to be compliant with the pt-spec the problematic
entries will end in `\=`.
Good find. The [https://gitweb.torproject.org/pluggable-
transports/goptlib.git/blob/refs/tags/0.2:/pt.go#l205 escape function]
isn't specified in pt-spec; it's just a safety valve I cooked up to handle
the case when someone tries to pass a string containing '\n' or '\x00',
which would otherwise trash the stdout interaction. But clearly using a
backslash escape is the wrong thing, because backslashes are used in other
parts of the protocol. Maybe we should just strip the problematic bytes,
or even panic. As far as I'm concerned it's undefined behavior, so we can
do what we want.
Could you write (and commit) a failing test that demonstrates the error?
I.e., in TestEscape, add test cases including backslashes and other bytes
we care about, and modify the check function to verify that if
`stringIsSafe(input)` is true, that `escape(input) == input`.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/12930#comment:3>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs