Skip to content

Autolinker vulnerable to RTLO URL spoofing attacks #377

Open
@dbrgn

Description

@dbrgn

When a URL string contains a unicode RTLO (right-to-left override) character, this results in two separate links being generated.

Context: https://www.bleepingcomputer.com/news/security/url-rendering-trick-enabled-whatsapp-signal-imessage-phishing/

PoC (screenshot, because GitHub would otherwise show the rest of the line as right-to-left):

screenshot-20220330-141920

Note that my terminal ignores the RTLO, but it's there. In the browser (Chrome in this case), this link looks like this:

screenshot-20220330-142044

The left and right part are separate links. When the user clicks on the right part, shown as aisa.mp4, they are redirected to http://4pm.asia/ instead.

I'm not sure what the ideal solution would be. If autolinker would strip all RTLO characters passed to it, then legitimate text (that's not part of an URL) might break. However, an RTLO should not be part of the actual URL. (Autolinker does basically no URL encoding whatsoever. Maybe that should be changed? An urlencoded RTLO would be handled (and ignored) by the browser.)

Activity

changed the title [-]Autolinker vulnerable to RTLO phishing attacks[/-] [+]Autolinker vulnerable to RTLO URL spoofing attacks[/+] on Mar 30, 2022
caleb15

caleb15 commented on Aug 1, 2022

@caleb15

@gregjacobs wondering if you saw this? Snyk lists this as a high-level vulnerability.

ShaharAdskAcc

ShaharAdskAcc commented on Aug 2, 2022

@ShaharAdskAcc

Any idea when it's going to be fixed?

Gilgahex

Gilgahex commented on Aug 2, 2022

@Gilgahex

@gregjacobs
@olafleur

Please see this pull request

#382

moblezin

moblezin commented on Aug 8, 2022

@moblezin

Hey, thanks for the fix, when will you be able to publish it to npm?

Gilgahex

Gilgahex commented on Aug 9, 2022

@Gilgahex

I'd love to but I don't have write access, so I'd have to fork it and create a new pkg on npm

RomekRJM

RomekRJM commented on Aug 10, 2022

@RomekRJM

As mentioned by @caleb15 this is high on SNYKs vulnerability risk. Any idea when the next Autolinker release is going to be? I see past 2 years it's been released annually.

gregjacobs

gregjacobs commented on Aug 20, 2022

@gregjacobs
Owner

Hey guys, waiting on a viable PR for this. The PR linked in this thread doesn't seem to do anything (although I'm surprised to see that the test passed. Perhaps there is a difference in which node version is running?)

yadue

yadue commented on Sep 6, 2022

@yadue
Contributor

@gregjacobs so you're saying that the fix provided doesn't work when you run it but units went correctly and fixed the original issue? I simply cannot understand that. Provided PR does exactly what it is supposed to do and the community is waiting for this PR for ages already.

Comment out
url.replace('\u202E', '');
and you'll see the result. Provided PR works fine, please merge it and deploy new version.

xfournet

xfournet commented on Sep 6, 2022

@xfournet

@yadue when i test it, the PR is not working, the added test test fails with or without the patch in url-match.ts (see comments in PR)

yadue

yadue commented on Sep 7, 2022

@yadue
Contributor

@xfournet yeah indeed, yesterday it worked simply fine for me using this PR, today it's not which is extremely weird. I'll work on fix.

gregjacobs

gregjacobs commented on Sep 7, 2022

@gregjacobs
Owner

Hey guys, this has been fixed and released in v3.16.1 👍

24 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Autolinker vulnerable to RTLO URL spoofing attacks · Issue #377 · gregjacobs/Autolinker.js