[NMDC] 4.10 Magnet Link left mouse in chat opens search

If you find any bugs, please post in here. Bugs in the Linux version should be reported on Github.

[NMDC] 4.10 Magnet Link left mouse in chat opens search

Postby Executer » 12 Jan 2021, 23:09

Hi

the following list of magnet links is not handled correctly
Code: Select all
magnet:?xt=urn:tree:tiger:MJINWSL5AJUTA7XKD4LYU77ZNV2O237R2HO6QLQ&xl=12&dn=i.txt
magnet:?xt=urn:tree:tiger:T4WCVG3SFL4EZPVQV5PD2S6VTQOP3VW22FHXQ3A&xl=14&dn=sdk+%26+dfj.txt
magnet:?xt=urn:tree:tiger:5MBKRFGPFAS74GO234WPHSMNL3PH53N5E47IDTY&xl=7&dn=f.txt
magnet:?xt=urn:tree:tiger:TQ6K2U6YLFR4MBZ7JPVRHW2NOULXGQLXFTBMCXA&xl=6&dn=g.txt

It appears to me the "%26" -> & breaks the handling of the link and those in the same message below it.
Clicking on the link above brings the expected magnet link detected window to download the file, the broken one and those below open a search instead.
Clicking on the working link above fixes the ones not handled as expected until airdc++ gets restarted.
Right mouse -> download worked as expected in my test.

Code: Select all
magnet:?xt=urn:tree:tiger:UVGAVVEPOCV6J4YO2GJYNG336JESOVKGGX37W7Q&xl=3&dn=a.txt
magnet:?xt=urn:tree:tiger:JG3H3V6GLWY2HSFKX4LUVIYAZAFJEIOYMYZZQ6I&xl=13&dn=a%23b.txt
magnet:?xt=urn:tree:tiger:YS3KLSN6YDVCADYJFNNWJRFMIMP7BWOUKXF2SOA&xl=15&dn=a+%23+c.txt

%23 "#" breaks too.

so does
Code: Select all
magnet:?xt=urn:tree:tiger:OUDHKSX2AFB3CXK5YTM3KSNQF6NH7DH7EEWFOUY&xl=6&dn=b.txt
magnet:?xt=urn:tree:tiger:XW6S5JEBIFMN7FGCONAU37YFQ632NDMMV3KE4RA&xl=13&dn=c+%40+q.txt
magnet:?xt=urn:tree:tiger:A2MBX2JYKX2G6E6NMOZYS5CB7CNKIAOEHCVCQQA&xl=13&dn=vc%40f.txt

%40 "@".

It seems to me does the copy magnet link and/or link handling in general are flawed and not robust when special or reserved characters in file names occur.
I've seen wierd things happening too, when someone used an opening parenthesis but didn't closed it in the filename. I understand does parsing and other things can get messed up by this, but normal users expect a "filename" to be simply handled as string and it should work as such even if it is not syntactically correct ;)
Executer
 
Posts: 2
Joined: 06 Dec 2019, 22:13

Re: 4.10 Magnet Link left mouse in chat opens search

Postby maksis » 18 Jan 2021, 13:54

This issue is reproducible only in NMDC hubs, as the links are working fine in ADC hubs
User avatar
maksis
Site Admin
 
Posts: 920
Joined: 23 Nov 2010, 18:56

Re: 4.10 Magnet Link left mouse in chat opens search

Postby Executer » 23 Jan 2021, 23:08

maksis wrote:This issue is reproducible only in NMDC hubs, as the links are working fine in ADC hubs


To my knowledge the hub we run is ADC and not NMDC.

Not knowing the protocol intrinsics, i simply post my findings, will read up on the topic :)
Our hub where the issue arised is running luadch 2.19. No changes made to the hub recently and the current and older versions of Airdc++ are affected.
I setup a clean luadch 2.21, same issue.
A test hub with ADCH++ 2.12.1 shows the same issue.


I am no programmer or expert in URI (magnet link), but my impression is, does the issue arises around reserved characters in magnet links in the "dn" (Display Name) part.
https://tools.ietf.org/html/rfc3986 Uniform Resource Identifier (URI): Generic Syntax
2.2. Reserved Characters
gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@"

sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
/ "*" / "+" / "," / ";" / "="


Test setup:
Assuming a clean hub main chat window (no chatlog, or containing no messages with a broken magnet link).
Connect with a fresh started Airdc++ client or close hub window between tests, a reconnect does not suffice, as it does not reset the link handling into a "clean" state.

The test message with the following structure
  1. magnet:?xt=urn:tree:tiger:MJINWSL5AJUTA7XKD4LYU77ZNV2O237R2HO6QLQ&xl=12&dn=i.txt
  2. magnet:?xt=urn:tree:tiger:T4WCVG3SFL4EZPVQV5PD2S6VTQOP3VW22FHXQ3A&xl=14&dn=sdk+%26+dfj.txt
  3. magnet:?xt=urn:tree:tiger:5MBKRFGPFAS74GO234WPHSMNL3PH53N5E47IDTY&xl=7&dn=f.txt
  4. magnet:?xt=urn:tree:tiger:TQ6K2U6YLFR4MBZ7JPVRHW2NOULXGQLXFTBMCXA&xl=6&dn=g.txt

  1. this link is fine
  2. this link contains a special character, breaking the handling of the link and the magnet links below it
  3. this link is fine, but broken by link 2
  4. this link is fine, but broken by link 2

The behaviour of Airdc++ is different depending the order in which the links are clicked.
Order: 4; 3; 2; 1; 4 ...
Search; Search; Search; Magnet Link detected (fixes the handling); Magnet Link detected

Order: 1; 2; 3; 4; 1 ...
Magnet Link detected, Magnet Link detected; Magnet Link detected ; Magnet Link detected; Magnet Link detected ...

Clicking the nonbroken link 1 fixes the link handling, in my test as long the client runs. Survives a reconnect. The situation resets when the window is closed or Airdc++ is closed.

If showing/reproducing the issue live helps clarifying things, feel free to contact me :)
Executer
 
Posts: 2
Joined: 06 Dec 2019, 22:13


Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 3 guests

cron