Facebook hidden redirection vulnerability
The reporter claimed that Facebook's link preview system could show a safe-looking URL while the actual clickable link pointed to a different, potentially malicious address. An attacker could use this to trick users into visiting blacklisted or harmful sites.
The reports I sent to Facebook were not evaluated as a vulnerability, it’s up to you…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
This is a write-up of a report submitted to the Facebook bug bounty programme on 16 October 2018 by Ege Ken, titled "Hidden malicious url redirection (as secure)". The product area is Facebook Web, and the weakness class is an open redirect, though the researcher argues throughout that it is more than a plain open redirect.
The feature at issue is the URL attachment that Facebook builds when a user pastes a URL into a post or a message. When you enter a URL, Facebook scrapes it and renders an attachment card containing an image, a title, a description and an open-graph style URL. The card itself is a link: the visible text is the URL you entered, but the anchor behind it (a href) is a separate value. The researcher's claim is that these two values can be made to differ, so that a card which looks like it points at a harmless address actually sends the clicker somewhere else, including to a domain on Facebook's blacklist.
Facebook's position, stated repeatedly by its handler Peter, is that redirects are filtered through a system called Linkshim, which dynamically detects and prevents spammy or malicious redirects using a variety of heuristics, and that open redirects are therefore excluded from the programme.
Setup
No special tooling, accounts or versions are described. The researcher worked against the normal Facebook web interface, using the post-sharing and messaging text boxes, and recorded proof-of-concept videos hosted on YouTube. The only artefacts referenced are those videos and a screenshot named what-is.png, which he attached to the report to define his terminology.
Finding it
The researcher noticed that the scrape system Facebook uses to build URL attachments can be made to follow a redirect. When the entered URL redirects, the attachment is built from the final destination rather than from the URL the user typed. The visible URL text and the anchor target are then no longer the same address, and the card can present the appearance of a safe link while the click lands on a blacklisted host.
He summarised the issue in the original submission as follows:
A malicious link can be placed on links that seem safe.

Facebook's first reply was the standard automated acknowledgement, assigning report number 178930656318909 and asking for reasonable time before disclosure.


Exploitation
Step 1: a redirecting URL in a post
The first proof of concept is a YouTube link, submitted as the reproduction steps:
https://www.youtube.com/watch?v=pIFhpGr-CFE
In the report the same link appears wrapped in Facebook's Linkshim redirector, with the destination percent-encoded in the u parameter and an h parameter appended:
https://l.facebook.com/l.php?u=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DpIFhpGr-CFE%26fbclid%[redacted]-wuzrXYXGp7a2_TU8QNmvA&h=AT0aaGJw0dppAJ_FH3fAnS-[redacted]
The u parameter carries the target and an h parameter is appended. The researcher offered to record a video of how the attachment was constructed if the team was interested.
Step 2: the first rejection
Peter replied that the report looked like a common false positive. Open redirects are generally excluded because redirects pass through Linkshim, which decides from heuristics whether to allow a redirect and can block particular domains or URLs, so a real-world attack could be detected and prevented. He invited the researcher to test Linkshim against a known malicious URL:
http://evilzone.org/
and noted that evil.com and similar names, despite the naming, are not considered malicious.

Step 3: a second proof of concept
The researcher answered with a new video and the argument that the scrape system is "wrong-missing": malicious links can be integrated into attachments that appear quite secure. He asked that several team members review it.
https://www.youtube.com/watch?v=5_6l1n1Sonk


Peter reviewed the video, saw that a redirect to a blacklisted site appeared possible, and asked for reproduction instructions, a proof of concept, technical detail, impact and suggested fixes.

Step 4: terminology and the full explanation
On 21 October the researcher sent a long message defining five terms, which are the core of the report.
- Direct-Redirection: redirecting a URL directly to another URL. His example, copied as written:
<?php header('Location: http://facebook.com/');
-
Url-Attachment: the attachment created when a URL is entered while sharing a post or writing a message.
-
Entered-Url: the URL typed into the text box, from which the attachment is built.
-
Integrated-Url: the
a hrefvalue inside the attachment, that is, the first address the browser opens when the card is clicked. In the normal case the Integrated-Url equals the Entered-Url. The difference is that the Entered-Url is text and can be deleted, while the Integrated-Url is the anchor attribute. -
Redirected-Address: when there is a Direct-Redirection, the last address reached after clicking the attachment. The flow is Integrated-Url to Redirected-Address.
He restated the vulnerability as the ability to integrate a different link into an attachment that looks safe, where that different link can be malicious, such as evilzone.org. His quick fix: the redirect should go to the URL seen in the attachment, not a different URL. He stressed that this is not just an open redirect, and asked the reader to consider what can be done with it in a popular group or page, or in messaging.




He showed two videos of the technique applied in that context:
https://www.youtube.com/watch?v=U9rR4DSueTA
https://www.youtube.com/watch?v=Mj49gQG7B4c
and a third in which the entered URL text is deleted, leaving only the attachment card, so the victim sees no URL at all and simply clicks the card:
https://www.youtube.com/watch?v=pUkfjOUJuTI
He also described an observed difference in handling. Before his report, posts built with this technique stayed published for days without being treated as spam or deleted. After the report, such posts were marked as spam and deleted, but the same technique still worked in messaging.
Step 5: proposed solutions
He attributed the cause to Facebook creating URL attachments with a "wrong-missing" system for direct redirections, and gave two options.
First solution. The data of the destination (image, title, description, open-graph URL) should not appear in the attachment. Either the attachment shows only the entered URL, or no attachment is created at all. Detection can be done by comparing the entered URL with the URL of the last address reached after the scrape; if they differ, a direct redirection was present. The result is that the Integrated-Url and the address the user is redirected to are equivalent, or there is no card and the URL is plain text.
Second solution. Keep the current behaviour, where the attachment carries the redirected address's data, but run a redirection-change-control system that continuously rechecks every attachment whose URL has a direct redirection, past and future, and updates the card immediately if the redirect target is removed or changed. Then the visible data and the anchor stay equivalent. He judged the first solution ideal, because the change-control system would be more risky and costly.
He closed with the question of how to reach a blacklisted link such as evilzone.org over Facebook, answering that with the vulnerability he defines the redirected address as an address on the blacklist on his own host, and that after a fix redirection to blacklisted links would be blocked.




Step 6: Facebook's final position
Peter replied that the team is aware of such hiding tools but that the issue is difficult to mitigate comprehensively. If a user owns a site containing an open redirect, they can link to their own site, which then redirects to a blacklisted site from there. The reason the recent proof-of-concept URLs were being blocked, he said, is that Linkshim was dynamically detecting and preventing malicious redirects originating from the researcher's website. Facebook considers its level of checking reasonable, will keep monitoring, and may make further changes if necessary.

The researcher followed up once more with the same video, noting that different URLs can still be integrated into attachments that look safe, and that he had explained how to avoid it in his long message.
https://www.youtube.com/watch?v=fgrU9MVb90Y


Peter's final answer was that, for the reasons already given, Facebook does not believe the behaviour poses a significant security risk and it does not qualify under the bug bounty programme. He pointed to the feedback form for feature suggestions. Peter's final answer was that it does not qualify under the bug bounty programme.
Root cause
The attachment is built from the result of scraping the entered URL, and the scrape follows redirects. The card's visible URL text comes from the entered URL, while the anchor and the card metadata come from the final destination. When the entered URL is a direct redirection, the two diverge, and the attacker controls the destination through the redirect on their own host.
The researcher's own observation was that his proof-of-concept URLs started being blocked only after he reported them. The researcher's own observation was that his proof-of-concept URLs started being blocked only after he reported them, which Peter attributed to Linkshim detecting malicious redirects originating from the researcher's site. Facebook's stated reason for not treating it as a vulnerability is structural: anyone who controls a site with an open redirect can chain through it, so blocking individual redirectors does not remove the class of behaviour.
Impact
According to the researcher, all Facebook users can be affected. A link shared with this technique in a popular group or page can reach many users who click without understanding what happened, and the same applies to a link sent as a private message. If the entered URL text is deleted, the victim sees only the attachment card and clicks it directly, which he says increases the danger. Facebook's assessment was that the behaviour does not pose a significant security risk and does not qualify for the programme.
Fix
No fix was applied. The researcher proposed the two solutions above: build the attachment from the entered URL only (or suppress the attachment) when a direct redirection is detected, or maintain a continuous redirection-change-control system that keeps every attachment's anchor and metadata in step with the current redirect target. Facebook declined, citing the difficulty of comprehensive mitigation and the fact that a user who owns a site with an open redirect can chain through it.
Variants to test
- Redirecting URL in a post. Paste a URL on your own host that issues a redirect to a different domain into the share box. A positive result is an attachment card whose visible URL is your host but whose anchor points at the redirect target.
- Redirecting URL in a message. Repeat the same in the messaging text box. A positive result is the same divergence in a private message, which is where the researcher says the behaviour persisted after posts were being removed.
- Deleted visible URL. After the card is created, delete the entered URL text and send or post only the card. A positive result is a clickable card with no visible URL that still lands on the redirect target.
- Blacklist destination. Point the redirect at a domain the platform treats as malicious, such as the
evilzone.orgexample used here. A positive result is that the card is created and the click reaches the blacklisted destination. - Redirect target changed after creation. Create the card, then change where your redirect points. A positive result is that the card's metadata and anchor do not reflect the new redirect target.
- Redirect chain through a benign-looking host. Use a redirect on a domain that looks unremarkable rather than an obviously hostile one.
What happened, in plain words
In October 2018 a security researcher named Ege Ken sent a report to Facebook's bug bounty programme. A bug bounty programme is a scheme where a company pays people for finding and reporting security problems in its products. The report was titled "Hidden malicious url redirection (as secure)". The product area was Facebook Web, meaning the normal website you use in a browser. The weakness class is called an open redirect, which is a situation where a website sends you on to another address, and someone can choose that other address. The researcher argued throughout that the problem was more than a plain open redirect.
The feature involved is the URL attachment. When you paste a web address into a Facebook post or a message, Facebook fetches that page and builds a little preview card. The card usually shows a picture, a title, a short description and the address. The card is also clickable: the text you see is the address you typed, but the actual link behind it is a separate value stored in the page. In web pages that link is written as a href, short for anchor hyperlink reference. The researcher's claim was that these two values, the visible text and the real link, can be made to differ. A card that looks like it points at a harmless address could actually send the person who clicks it somewhere else, including to a domain on Facebook's blacklist. A blacklist here is a list of addresses the platform treats as bad or malicious.
Facebook's position, stated several times by its handler Peter, was that redirects are filtered through a system called Linkshim. Linkshim is Facebook's redirect filter: it looks at where a link is trying to send you and uses a variety of heuristics, meaning rules of thumb and signals, to decide whether to allow the redirect. It can also block particular domains or URLs. Because of that, Facebook said, open redirects are excluded from the programme.
Setup
The report describes no special tools, accounts or software versions. The researcher worked against the normal Facebook web interface, using the boxes for sharing a post and for writing a message. He recorded proof-of-concept videos, which means demonstration videos showing the problem in action, and hosted them on YouTube. The only other artefacts mentioned are those videos and a screenshot named what-is.png, which he attached to the report to define his terminology.
Finding it
The researcher noticed that the system Facebook uses to build URL attachments can be made to follow a redirect. When the address you enter redirects, the preview card is built from the final destination rather than from the address you typed. The visible address text and the real link behind the card are then no longer the same address. The card can therefore present the appearance of a safe link while the click lands on a blacklisted host.
He summarised the issue in the original submission as follows:
A malicious link can be placed on links that seem safe.

Facebook's first reply was the standard automated acknowledgement. It assigned report number 178930656318909 and asked for reasonable time before the researcher shared information with others.


Exploitation
Step 1: a redirecting URL in a post
The first proof of concept is a YouTube link, submitted as the reproduction steps:
https://www.youtube.com/watch?v=pIFhpGr-CFE
This is simply a web address. The point of submitting it was to show the team what to open in order to see the behaviour.
In the report the same link appears wrapped in Facebook's Linkshim redirector. A redirector is an address that takes you onward to another address. Here the destination is percent-encoded in the u parameter, and an h parameter is appended:
https://l.facebook.com/l.php?u=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DpIFhpGr-CFE%26fbclid%[redacted]-wuzrXYXGp7a2_TU8QNmvA&h=AT0aaGJw0dppAJ_FH3fAnS-[redacted]
Line by line in plain words: the address starts at l.facebook.com/l.php, which is Facebook's redirect service. The ? begins the parameters, the extra pieces of information sent with the address. The u parameter carries the target address. Percent-encoding is a way of writing characters that are not allowed directly in a web address, so %3A stands for a colon and %2F stands for a slash. The h parameter is an extra value appended to the redirect address. The researcher offered to record a video of how the attachment was constructed if the team was interested.
Step 2: the first rejection
Peter replied that the report looked like a common false positive, meaning a report that looks like a bug but is not one. Open redirects are generally excluded because redirects pass through Linkshim. Linkshim decides from heuristics whether to allow a redirect and can block particular domains or URLs, so a real-world attack could be detected and prevented. He invited the researcher to test Linkshim against a known malicious address:
http://evilzone.org/
This is an example address the team treats as malicious. He also noted that evil.com and similar names, despite the naming, are not considered malicious.

Step 3: a second proof of concept
The researcher answered with a new video and the argument that the scrape system is "wrong-missing". Scraping here means fetching a page and reading its details to build the preview card. His point was that malicious links can be integrated into attachments that appear quite secure. He asked that several team members review it.
https://www.youtube.com/watch?v=5_6l1n1Sonk


Peter reviewed the video, saw that a redirect to a blacklisted site appeared possible, and asked for reproduction instructions, a proof of concept, technical detail, impact and suggested fixes.

Step 4: terminology and the full explanation
On 21 October the researcher sent a long message defining five terms. These definitions are the core of the report, so they are worth reading slowly.
- Direct-Redirection: redirecting a URL directly to another URL. His example, copied as written:
<?php header('Location: http://facebook.com/');
This is a line of PHP, a programming language used on web servers. header('Location: ...') tells the browser to go to the address given. In everyday terms it is like a sign on a door saying "this office has moved, please go to this other address".
-
Url-Attachment: the attachment created when a URL is entered while sharing a post or writing a message. This is the preview card described earlier.
-
Entered-Url: the URL typed into the text box, from which the attachment is built. This is the address you actually typed.
-
Integrated-Url: the
a hrefvalue inside the attachment, that is, the first address the browser opens when the card is clicked. In the normal case the Integrated-Url equals the Entered-Url. The difference is that the Entered-Url is text and can be deleted, while the Integrated-Url is the anchor attribute, the hidden link value. A useful comparison is a parcel: the label on the outside says one address, but the delivery instructions inside could say another. -
Redirected-Address: when there is a Direct-Redirection, the last address reached after clicking the attachment. The flow is Integrated-Url to Redirected-Address.
He restated the vulnerability as the ability to integrate a different link into an attachment that looks safe, where that different link can be malicious, such as evilzone.org. His quick fix: the redirect should go to the URL seen in the attachment, not a different URL. He stressed that this is not just an open redirect, and asked the reader to consider what can be done with it in a popular group or page, or in messaging.




He showed two videos of the technique applied in that context:
https://www.youtube.com/watch?v=U9rR4DSueTA
https://www.youtube.com/watch?v=Mj49gQG7B4c
and a third in which the entered URL text is deleted, leaving only the attachment card. The victim then sees no URL at all and simply clicks the card:
https://www.youtube.com/watch?v=pUkfjOUJuTI
He also described an observed difference in handling. Before his report, posts built with this technique stayed published for days without being treated as spam or deleted. After the report, such posts were marked as spam and deleted, but the same technique still worked in messaging.
Step 5: proposed solutions
He attributed the cause to Facebook creating URL attachments with a "wrong-missing" system for direct redirections, and gave two options.
First solution. The data of the destination (image, title, description, open-graph URL) should not appear in the attachment. Open-graph is a set of tags a page uses to describe itself for previews. Either the attachment shows only the entered URL, or no attachment is created at all. Detection can be done by comparing the entered URL with the URL of the last address reached after the scrape. If they differ, a direct redirection was present. The result is that the Integrated-Url and the address the user is redirected to are equivalent, or there is no card and the URL is plain text.
Second solution. Keep the current behaviour, where the attachment carries the redirected address's data, but run a redirection-change-control system. That is a system that continuously rechecks every attachment whose URL has a direct redirection, past and future, and updates the card immediately if the redirect target is removed or changed. Then the visible data and the anchor stay equivalent. He judged the first solution ideal, because the change-control system would be more risky and costly.
He closed with the question of how to reach a blacklisted link such as evilzone.org over Facebook. His answer was that with the vulnerability he defines the redirected address as an address on the blacklist on his own host, and that after a fix redirection to blacklisted links would be blocked.




Step 6: Facebook's final position
Peter replied that the team is aware of such hiding tools but that the issue is difficult to mitigate comprehensively, meaning hard to fix in a way that covers every case. If a user owns a site containing an open redirect, they can link to their own site, which then redirects to a blacklisted site from there. The reason the recent proof-of-concept URLs were being blocked, he said, is that Linkshim was dynamically detecting and preventing malicious redirects originating from the researcher's website. Facebook considers its level of checking reasonable, will keep monitoring, and may make further changes if necessary.

The researcher followed up once more with the same video, noting that different URLs can still be integrated into attachments that look safe, and that he had explained how to avoid it in his long message.
https://www.youtube.com/watch?v=fgrU9MVb90Y


Peter's final answer was that, for the reasons already given, Facebook does not believe the behaviour poses a significant security risk and it does not qualify under the bug bounty programme. He pointed to the feedback form for feature suggestions. Peter's final answer was that it does not qualify under the bug bounty programme.
Root cause
The attachment is built from the result of scraping the entered URL, and the scrape follows redirects. The card's visible URL text comes from the entered URL, while the anchor and the card metadata come from the final destination. When the entered URL is a direct redirection, the two diverge, and the attacker controls the destination through the redirect on their own host.
The researcher's own observation was that his proof-of-concept URLs started being blocked only after he reported them. The researcher's own observation was that his proof-of-concept URLs started being blocked only after he reported them, which Peter attributed to Linkshim detecting malicious redirects originating from the researcher's site. Facebook's stated reason for not treating it as a vulnerability is structural: anyone who controls a site with an open redirect can chain through it, so blocking individual redirectors does not remove the class of behaviour.
Impact
According to the researcher, all Facebook users can be affected. A link shared with this technique in a popular group or page can reach many users who click without understanding what happened, and the same applies to a link sent as a private message. If the entered URL text is deleted, the victim sees only the attachment card and clicks it directly, which he says increases the danger. Facebook's assessment was that the behaviour does not pose a significant security risk and does not qualify for the programme.
Fix
No fix was applied. The researcher proposed the two solutions above: build the attachment from the entered URL only, or suppress the attachment, when a direct redirection is detected; or maintain a continuous redirection-change-control system that keeps every attachment's anchor and metadata in step with the current redirect target. Facebook declined, citing the difficulty of comprehensive mitigation and the fact that a user who owns a site with an open redirect can chain through it.
Variants to test
- Redirecting URL in a post. Paste a URL on your own host that issues a redirect to a different domain into the share box. A positive result is an attachment card whose visible URL is your host but whose anchor points at the redirect target.
- Redirecting URL in a message. Repeat the same in the messaging text box. A positive result is the same divergence in a private message, which is where the researcher says the behaviour persisted after posts were being removed.
- Deleted visible URL. After the card is created, delete the entered URL text and send or post only the card. A positive result is a clickable card with no visible URL that still lands on the redirect target.
- Blacklist destination. Point the redirect at a domain the platform treats as malicious, such as the
evilzone.orgexample used here. A positive result is that the card is created and the click reaches the blacklisted destination. - Redirect target changed after creation. Create the card, then change where your redirect points. A positive result is that the card's metadata and anchor do not reflect the new redirect target.
- Redirect chain through a benign-looking host. Use a redirect on a domain that looks unremarkable rather than an obviously hostile one.
Glossary
- Bug bounty programme: a scheme where a company pays people for finding and reporting security problems in its products.
- Open redirect: a situation where a website sends you on to another address, and someone can choose that other address.
- URL attachment: the preview card Facebook builds when you paste a web address into a post or message, showing a picture, title, description and address.
a href: the part of a web page that stores the real link behind clickable text.- Blacklist: a list of addresses the platform treats as bad or malicious.
- Linkshim: Facebook's redirect filter, which uses heuristics to decide whether to allow a redirect and can block particular domains or URLs.
- Heuristics: rules of thumb and signals used to make a decision.
- Proof of concept: a demonstration showing a problem in action.
- Percent-encoding: a way of writing characters that are not allowed directly in a web address, such as
%3Afor a colon and%2Ffor a slash. - Parameter: an extra piece of information sent with a web address, after the
?. - Integrity value: a value used by a filter to check that a redirect is legitimate.
- False positive: a report that looks like a bug but is not one.
- Scrape: to fetch a page and read its details, here to build the preview card.
- Integrated-Url: the
a hrefvalue inside the attachment, the first address the browser opens when the card is clicked. - Open-graph: a set of tags a page uses to describe itself for previews.
- Redirection-change-control system: a system that continuously rechecks attachments whose URL has a direct redirection and updates the card if the redirect target changes.
- Mitigate: to reduce or fix a problem.
- Spam: unwanted or abusive content that a platform may remove.