Opened 3 years ago

Closed 3 years ago

#2127 closed defect (not a bug)

I2PSnark: Screenlog and torrent magnet links should not escape '&'

Reported by: Reportage Owned by: zzz
Priority: minor Milestone: 0.9.33
Component: apps/i2psnark Version: 0.9.32
Keywords: i2psnark escaped ampersand Cc:
Parent Tickets: Sensitive: no


In screen log and magnet links displayed in the main torrent table, '&' is escaped in the torrent name, resulting in & being displayed which it shouldn't be in these contexts.


Change History (8)

comment:1 Changed 3 years ago by zzz

Milestone: undecided0.9.33
Status: newaccepted

comment:2 Changed 3 years ago by zzz

Having trouble reproducing. & in regular torrent names seems to be fine both in logs and in main table.

For magnet names inside the (), I modified a config file for a magnet to add a & to the name and that looks fine both in logs and the main table also.

I tried adding a magnet link with a & in the name e.g. magnet:xt...&dn=foo&bar&tr=… and it clips the name after foo, so the URI parser isn't unescaping the & in the dn parameter, so I can't get a & into the name on form submission. That's a bug that's blocking me from reproducing your bug.

Please give me the steps to reproduce, and what screen log messages you see it in, thanks

comment:3 Changed 3 years ago by zzz

I did find that when you add a non-magnet link from, say, postman, the screen log says Fetching xxx&xxx so it is double-escaped there

comment:4 Changed 3 years ago by Reportage

Try this magnet link: magnet:?xt=urn:btih:c3935639a43e9b3f2939098aae4ede1d5ec73a93&dn=Victoria+%26amp%3B+Abdul+2017+%281080p+x265+10bit+Tigole%29

'&' appears in both screenlog and in the torrent listing while the magnet is being fetched.

comment:5 Changed 3 years ago by zzz

Yeah, reproduced with that, but I'm not sure that magnet link is escaped correctly, with both URI and HTML escaping: %26amp%3B - shouldn't it be just %26?

will research further, thanks

comment:6 Changed 3 years ago by Reportage

It could be a mangled attempt to encode '&' as %3B is the escaped encoding for a semi-colon. Maybe will shed some light, maybe not.

comment:7 Changed 3 years ago by zzz

Comment 3 issue fixed in 722138d0e9cb6615a700bdce4247df2c95049392 to be 0.9.32-19

Fairly certain the '&' in the dn param of the magnet link should be encoded as %26, not %26amp%3B, which is a double-escaping.

I couldn't find any similar example of double-encoding on any common tracker. You didn't say where you got that magnet link, I assume it didn't come out of i2psnark or you would have said so?

You may wish to report it to the site where you got the link and see what they say.

Leaving ticket open for now but inclined to close it without additional changes.

comment:8 Changed 3 years ago by zzz

Resolution: not a bug
Status: acceptedclosed

Closing as discussed in comment above.

Note: See TracTickets for help on using tickets.