Skip to content
Open redirect Write-up Intermediate

Crowdsource Success Story: From an Out-of-Scope Open Redirect to CVE-2020-1323

An open redirect vulnerability existed in a Microsoft SharePoint endpoint that accepted a redirect_uri parameter. An attacker could craft a link that bypassed the redirect validation to send users to a malicious site, though a valid client_id was also needed for full exploitation.

Ozgur Alp Follow

Published on blog.detectify.com

{{media:0}}

Ozgur Alp (@ozgur_bbh), on blog.detectify.com

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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 6 min read.

Context

This is the story of how an open redirect on a Microsoft SharePoint endpoint, initially rejected as out of scope, ended up patched and assigned CVE-2020-1323. The researcher is Özgür Alp (@ozgur_bbh), and the write-up was published through Detectify Crowdsource.

The vulnerable feature is the SharePoint application redirect endpoint /_layouts/15/appredirect.aspx, which takes a redirect_uri parameter. The researcher first met it on a private bug bounty program as appredirect.aspx with a redirect_uri value of https://appdomain.com/validpath.aspx.

From the original on blog.detectify.com

Setup

There were no special accounts or tools described beyond a fuzzing workflow: the researcher generated custom open redirect payload lists and fuzzed the redirect_uri parameter. The preconditions that matter for exploitation are:

  • A SharePoint instance exposing /_layouts/15/appredirect.aspx.
  • A valid client_id parameter, which is needed for full exploitation when the endpoint is not used directly at that instance.
  • A redirect_uri value that passes the endpoint's security controls.

The endpoint was not present, or returned forbidden, on some SharePoint instances, and no generic endpoint existed for enumerating client_id values directly, which limited how widely the bug could be reproduced.

Finding it

The researcher noticed the endpoint appredirect.aspx with a redirect_uri parameter pointing at https://appdomain.com/validpath.aspx. A parameter containing "redirect" alongside an application URL is a natural candidate for an open redirect check, so the parameter was fuzzed with custom generated open redirect lists.

The endpoint had security measures in place, but they could be bypassed with one kind of payload, so it was vulnerable to open redirect attacks. The bug was reported to the private program and paid $200. The researcher kept testing.

Further testing showed the application used Microsoft SharePoint as its content management system. Because SharePoint is widely deployed, the researcher checked the Microsoft Security Response Center bounty page. URL redirects are listed there as out of scope unless combined with another vulnerability that produces something more severe.

Attempts to chain the redirect with another misconfiguration to raise impact were unsuccessful. A few other instances of the same vulnerability were found on various programs and reported, but not many, for two reasons: the endpoint did not exist or returned forbidden on some SharePoint instances, and full exploitation required knowing a client_id when the endpoint was not used directly, with no generic endpoint available to enumerate client_id values.

Before giving up, the researcher reported it to Detectify, whose bug bounty platform accepts open redirect reports regardless of vendor.

Exploitation

Step 1: Confirm the redirect parameter

The starting point was the endpoint and parameter seen on the private program:

redirect_uri carries the destination. Fuzzing it with open redirect payload lists showed that conventional payloads were blocked but one kind of payload bypassed the controls.

Step 2: Bypass the redirect validation

On SharePoint instances the endpoint is:

Text
/_layouts/15/appredirect.aspx

with the parameter redirect_uri. The control blocks conventional payloads such as https://maliciousdomain.com. The bypass payload is:

Text
https://whitelisteddomain.com%23%40maliciousdomain.com

The payload places the whitelisted domain first and hides the malicious domain behind encoded # and @ characters.

Step 3: Supply a valid client_id

For full exploitation a valid client_id parameter must also be used on the link. It can be gathered by crawling application pages once a SharePoint instance is recognised. Because no endpoint enumerates client_id values for this endpoint, exploitation is effectively impossible without first finding valid redirection endpoints that use appredirect.aspx.

Step 4: Find candidate instances

The researcher notes that a Google dork may return vulnerable endpoints:

Text
appredirect.aspx inurl:redirect_uri

Step 5: Escalate through Detectify Crowdsource

The bug was submitted to Detectify Crowdsource as a 0-day because it was unpatched at Microsoft. The proof-of-concept report was accepted and developed into a live module, meaning the Crowdsource team validated the payload. The 0-day mark was removed, which the researcher did not question at first.

A message over Twitter ("I saw your name in Detectify for the Sharepoint open redirect, are you willing to share?") prompted a check on disclosure status. The Detectify Crowdsource team found that a bug in the submission had accidentally removed the 0-day mark through backend automation. The module was removed from production, marked as 0-day again, and responsible disclosure was coordinated between Microsoft and the researcher.

After the 45-day patching and response window that Detectify Crowdsource gives vendors for 0-day reports, the module went live in the Detectify scanner again for all users.

Microsoft initially kept its position that URL redirects are low impact and out of scope, which was the expected result and the reason the bug was not reported to Microsoft directly in the first place. Two months later the Detectify Crowdsource team followed up, worked with Microsoft to get the bug patched and assigned CVE-2020-1323, and the researcher was recognised in the June Hall of Fame. Two weeks after that, Detectify Crowdsource relayed Microsoft's bounty decision: $1200 in total. Because Microsoft patched the report, the submission also became eligible for the Crowdsource 0-day bonus.

Root cause

The endpoint validates redirect_uri but the validation can be bypassed with a crafted URL that combines an encoded fragment marker and an encoded @. The whitelisted domain appears at the start of the value, and the payload bypasses the control. The report does not describe the validation code, so the exact parsing mistake is not stated; the bypass is demonstrated by the payload above.

Impact

The endpoint was vulnerable to open redirect attacks, and full exploitation requires a valid client_id and a reachable appredirect.aspx endpoint. Full exploitation requires a valid client_id and a reachable appredirect.aspx endpoint. Microsoft treated plain URL redirects as low impact and out of scope, and the report notes that the endpoint was missing or forbidden on some instances. The eventual outcome was a patch, CVE-2020-1323, a $1200 bounty and a Hall of Fame entry.

Fix

Microsoft patched the vulnerability and assigned CVE-2020-1323. The report does not describe the code change. It does give remediation guidance for open redirects in general:

  • If redirects stay on the same domain, prefix the application domain to the path, for example https://appdomain.com/page.aspx, rather than accepting only paths such as /page.aspx, regardless of the payload.
  • If redirects go to different domains, check the destination domains on the backend for whether they are malicious.
  • Analyse how different browsers handle redirects and avoid bypass techniques. A payload list including bypasses is referenced: https://raw.githubusercontent.com/cujanovic/Open-Redirect-Payloads/master/Open-Redirect-payloads.txt.

Variants to test

  • Other SharePoint instances: look for /_layouts/15/appredirect.aspx with redirect_uri. A positive result is a redirect to an external domain after supplying a valid client_id.
  • Encoded delimiter bypasses: try values that place a whitelisted host first and hide the real destination behind encoded # and @, as in the payload above. A positive result is the browser landing on the attacker domain while the server accepts the value.
  • client_id discovery: crawl SharePoint application pages for client_id values and pair them with appredirect.aspx links. A positive result is a working redirect chain with a valid client_id.
  • Dork-based discovery: search for appredirect.aspx inurl:redirect_uri and test each hit. A positive result is an endpoint that accepts the bypass payload.

Timeline

Date Event
27 Jan Vulnerability discovered and reported on a private program
31 Jan Report submitted to Detectify
5 Feb Module set live at Detectify
13 Feb Message received over Twitter
13 Feb Module removed from Detectify and team contacted Microsoft
26 Mar Microsoft rejected the report as out of scope
1 Apr Module set live again at Detectify after 45 days
12 Jun Microsoft confirmed the patch and assigned the CVE
24 Jun Microsoft awarded the bounty
From the original on blog.detectify.com

Written by Özgür Alp (@ozgur_bbh).

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 13 min read.

What happened, in plain words

A security researcher found a small flaw in a Microsoft product called SharePoint. The flaw let a link on a trusted website send visitors to a website the attacker controls. Microsoft first said this kind of flaw was not serious enough to pay for. Later, after a security company called Detectify pushed the report through its own process, Microsoft changed its mind, fixed the flaw, gave it an official identifier (CVE-2020-1323) and paid a reward.

The researcher is Özgür Alp (@ozgur_bbh). Detectify Crowdsource is a programme where outside researchers send in bugs and Detectify turns the confirmed ones into checks that its customers' scanners can run. The story was published through that programme.

From the original on blog.detectify.com

The picture above accompanies the story of an open redirect that became a publicly disclosed vulnerability with a CVE number.

Before the details, two ideas you need:

  • Open redirect. A redirect is when a website tells your browser "go to this other address instead". That is normal and useful, for example after you log in. It becomes an open redirect when the website lets the address be chosen by whoever builds the link, without checking it. An attacker can then build a link that starts on the trusted site and ends on a site they control. The victim sees the trusted name in the link and clicks.
  • SharePoint. Microsoft SharePoint is software that companies use to build internal websites, store documents and run small web applications. Think of it as a ready-made office building that many companies move into, so a flaw in one part of the building can exist in thousands of companies at once.

Setup

The report does not describe any special accounts or tools. The only working method mentioned is fuzzing: sending many variations of a value automatically and watching which ones behave differently. The researcher generated his own lists of open redirect test values and ran them against one parameter.

For the flaw to be exploitable, three things have to be true:

  1. A SharePoint site must expose the endpoint /_layouts/15/appredirect.aspx. An endpoint is simply a specific address on a website that does one job, like a particular counter in a building.
  2. A valid client_id value is needed for full exploitation when the endpoint is not used directly on that site. A client_id is an identifier that tells SharePoint which registered application is asking; think of it as a membership number that the door checks.
  3. The redirect_uri value must get past the endpoint's security checks. redirect_uri is the parameter that carries the destination address.

Two limits made the bug hard to reproduce widely. On some SharePoint sites the endpoint did not exist at all, or it answered with "forbidden". And there was no general endpoint that listed client_id values, so finding a usable one meant looking through the site by hand.

Finding it

The researcher was doing his normal daily bug bounty work on a private programme. A private programme is a company's invitation-only scheme that pays researchers for reporting bugs. There he saw an address called appredirect.aspx with a redirect_uri parameter set to https://appdomain.com/validpath.aspx.

Why did that catch his eye? Because a parameter whose name contains "redirect" and whose value is a full web address is exactly where an open redirect would live. It is like seeing a door labelled "exit" and checking whether anyone can open it from the outside.

He fuzzed the parameter with his custom open redirect lists. The endpoint did have protections, but one kind of test value got past them, so the endpoint was vulnerable to open redirect attacks. He reported it to the private programme and was paid $200. He did not stop there.

Further testing showed the application used Microsoft SharePoint as its content management system. A content management system is the software a company uses to publish and organise its web pages. Because SharePoint is used by a huge number of organisations, he thought there might be more to gain.

He first checked the Microsoft Security Response Center bounty page. That is Microsoft's public page explaining which bugs it pays for. It lists URL redirects as out of scope, unless they are combined with another vulnerability to produce something more severe. "Out of scope" means the company has decided in advance not to accept or pay for that class of report.

So he went back to the bug and tried to chain it with another misconfiguration to raise the impact. Chaining means using one small flaw to reach a bigger one, like using a loose window to get to a locked door. He was not successful. He also found a few other instances of the same flaw on various programmes and reported them, but not many, for the two reasons above: the endpoint was missing or forbidden on some SharePoint sites, and full exploitation needed a client_id that was hard to find.

Before giving up completely, he reported it to Detectify, because their bug bounty platform accepts open redirect reports regardless of the vendor. That decision is where the story turns.

Exploitation

Step 1: Confirm the redirect parameter

The starting point was the endpoint and parameter he saw on the private programme:

Line by line:

  • appredirect.aspx is the page on the website that performs the redirect. The .aspx ending tells you it is a page built with Microsoft's web technology.
  • ? marks the start of the parameters, the extra information sent with the request.
  • redirect_uri= is the parameter name. uri means a web address.
  • https://appdomain.com/validpath.aspx is the value: the address the browser should be sent to. In the real case this was the application's own valid page.

redirect_uri carries the destination. Fuzzing it with open redirect payload lists showed that ordinary test values were blocked, but one kind of value got through the controls. A payload here just means the value you put into the parameter to test it.

Step 2: Bypass the redirect validation

On SharePoint sites the endpoint is:

Text
/_layouts/15/appredirect.aspx

Line by line:

  • The leading / means the path starts at the root of the website.
  • _layouts is a folder that SharePoint uses for its built-in pages.
  • 15 is a version folder inside it.
  • appredirect.aspx is the page itself.

This page takes the parameter redirect_uri. The protection blocks ordinary payloads such as https://maliciousdomain.com. The bypass payload is:

Text
https://whitelisteddomain.com%23%40maliciousdomain.com

Line by line:

  • https://whitelisteddomain.com is a domain the site trusts. The check looks at the start of the value and sees this trusted name, so it lets the value through.
  • %23 is the encoded form of the # character. In a web address, # starts the fragment, the part of the address that points to a spot inside a page. Browsers do not send the fragment to the server.
  • %40 is the encoded form of the @ character. In a web address, an @ separates login details (userinfo) from the host name.
  • maliciousdomain.com is the attacker's domain, hidden after those two encoded characters.

The payload places the trusted domain first and hides the attacker's domain behind encoded # and @ characters. The result is that the visitor ends up on the attacker's domain even though the link looked trusted. The report does not include the validation code, so the exact parsing mistake inside SharePoint is not described; the payload above is the demonstration.

Step 3: Supply a valid client_id

For full exploitation, a valid client_id parameter must also be on the link. It can be gathered by crawling the application's pages once you recognise the site as SharePoint. Crawling means following links page by page and collecting what you find, like walking the corridors and noting the door numbers. Because no endpoint lists client_id values for this page, exploitation is effectively impossible without first finding valid redirect links that use appredirect.aspx.

Step 4: Find candidate instances

The researcher notes that a Google search with a special pattern, called a dork, may return vulnerable endpoints:

Text
appredirect.aspx inurl:redirect_uri

Line by line:

  • appredirect.aspx is the text to look for on pages.
  • inurl:redirect_uri tells Google to return only pages whose address contains redirect_uri.

A dork is just a search query built to find pages with a particular shape. It is a way of asking a search engine to list possible targets instead of guessing addresses one by one.

Step 5: Escalate through Detectify Crowdsource

The bug was submitted to Detectify Crowdsource as a 0-day, because at that point Microsoft had not patched it. A 0-day means a flaw that the vendor does not yet have a fix for. The proof-of-concept report was accepted and turned into a live module. A module is a check inside Detectify's scanner; "live" means customers' scans now run it. The Crowdsource team validated the payload before the module went live.

The 0-day mark was then removed. The researcher did not question it at first.

A message over Twitter changed that: "I saw your name in Detectify for the Sharepoint open redirect, are you willing to share?" Someone had seen his name attached to the finding and wanted the details. That made him think about whether sharing publicly was ethical without telling Microsoft first. He believes in knowledge-sharing in the community, but he wanted to double-check the status with Detectify and whether the finding was available for disclosure.

When he went back to the Detectify Crowdsource team, they found that a bug in his submission had accidentally removed the 0-day mark through automation on the backend. In other words, a fault in the submission system, not a decision by a person, had changed the label. The team removed the module from the production system, marked it as 0-day again, and started coordinating responsible disclosure between Microsoft and the researcher. Responsible disclosure is the practice of telling the vendor privately and giving them time to fix before anything is made public.

After 45 days, the patching and response window that Detectify Crowdsource gives vendors for 0-day reports, the module went live in the Detectify scanner again and was available to all their users.

Fortune strikes back

For a while Microsoft did not change its position: URL redirects were low impact and out of scope. This was the expected result, and it is why the researcher had not reported it to Microsoft directly in the first place.

Two months later, the Detectify Crowdsource team followed up on the report. They worked with Microsoft to get the bug patched and assigned CVE-2020-1323, which made it eligible for future bounty payouts. A CVE is a public catalogue number for a known vulnerability, so anyone can look it up. Because of this, the researcher was also recognised in the June Hall of Fame, a public list of researchers a company thanks.

Persistence and collaboration pays off

He was surprised and pleased that Microsoft changed its decision. He expected the bounty to be small, a few dollars at most, since the impact was low, but anything is better than nothing.

That expectation changed two weeks later when Detectify Crowdsource contacted him again about Microsoft's bounty decision: $1200 in total. It was a shock, and a satisfying one. The team also told him that because Microsoft had patched the report, the submission was now eligible for the Crowdsource 0-day bonus as well.

He credits Detectify Crowdsource's professionalism and its advocacy for bug hunters, and the work of making the internet safer, for the reward and the place in the hall of fame.

Technical details

For readers who want the vulnerability details, here they are as the report gives them:

  • On SharePoint instances there is an endpoint at /_layouts/15/appredirect.aspx with the parameter redirect_uri. Security controls exist for this parameter and they do not allow conventional payloads such as https://maliciousdomain.com. It is possible to bypass the control with the payload https://whitelisteddomain.com%23%40maliciousdomain.com.
  • A valid client_id parameter should also be used on the link for full exploitation. It can be gathered while crawling application pages once you notice the site is a SharePoint instance.
  • Since no endpoint exists that lists client_id values for this endpoint, exploitation seems impossible without finding valid redirection endpoints that use appredirect.aspx.
  • Searching the dork appredirect.aspx inurl:redirect_uri in Google may return vulnerable endpoints.

Remediation techniques

Remediation means the fix. For those curious about how open redirects are prevented, the report gives these controls:

  • If redirects stay on the same domain, add the application domain as a prefix, for example https://appdomain.com/page.aspx, instead of accepting only paths such as /page.aspx, no matter what the redirected payload is. The point is to build the final address yourself from a known-good base rather than trusting what the visitor sent.
  • If redirects go to different domains, check the destination domains on the backend to see whether they are malicious. The backend is the server side, the part the visitor cannot see or change.
  • Analyse how different web browsers handle redirects, and avoid bypass techniques. A good list of payloads including bypasses is at https://raw.githubusercontent.com/cujanovic/Open-Redirect-Payloads/master/Open-Redirect-payloads.txt.

Variants to test

  • Other SharePoint instances: look for /_layouts/15/appredirect.aspx with redirect_uri. A positive result is a redirect to an external domain after supplying a valid client_id.
  • Encoded delimiter bypasses: try values that put a trusted host first and hide the real destination behind encoded # and @, as in the payload above. A positive result is the browser landing on the attacker's domain while the server accepts the value.
  • client_id discovery: crawl SharePoint application pages for client_id values and pair them with appredirect.aspx links. A positive result is a working redirect chain with a valid client_id.
  • Dork-based discovery: search for appredirect.aspx inurl:redirect_uri and test each hit. A positive result is an endpoint that accepts the bypass payload.

Timeline

Date Event
27 Jan Vulnerability discovered and reported on a private programme
31 Jan Report submitted to Detectify
5 Feb Module set live at Detectify
13 Feb Message received over Twitter
13 Feb Module removed from Detectify and team contacted Microsoft
26 Mar Microsoft rejected the report as out of scope
1 Apr Module set live again at Detectify after 45 days
12 Jun Microsoft confirmed the patch and assigned the CVE
24 Jun Microsoft awarded the bounty
From the original on blog.detectify.com

Written by Özgür Alp (@ozgur_bbh).

Glossary

  • 0-day: a vulnerability that the vendor has not yet fixed, so there is no patch available.
  • Backend: the server side of a system, the part users do not see or control directly.
  • Bug bounty programme: a scheme where an organisation pays researchers for reporting security flaws. A private programme is invitation-only.
  • Bypass: getting past a security check without removing it, by giving input the check does not handle correctly.
  • Chaining: combining one flaw with another to reach a bigger impact than either gives alone.
  • client_id: an identifier that tells SharePoint which registered application is making the request.
  • Content management system: software used to create, organise and publish website content.
  • Crawling: following links through a website automatically or by hand to collect information.
  • CVE: a public catalogue number assigned to a known vulnerability so it can be referenced and looked up.
  • Dork: a search engine query built to find pages with a particular pattern.
  • Endpoint: a specific address on a website that performs one particular job.
  • Fragment: the part of a web address after #, pointing to a place inside a page; browsers do not send it to the server.
  • Fuzzing: sending many automatically generated variations of an input and watching for unusual behaviour.
  • Hall of Fame: a public list where an organisation thanks researchers who reported bugs.
  • Module: in a scanner, a packaged check for one specific vulnerability.
  • Open redirect: a redirect where the destination can be chosen by whoever builds the link, without proper validation.
  • Out of scope: a class of report a programme has decided in advance not to accept or pay for.
  • Parameter: an extra piece of information sent with a web request, usually after ? in the address.
  • Payload: the value you put into a parameter to test or exploit it.
  • Proof of concept: a minimal demonstration that a vulnerability can actually be triggered.
  • Redirect: a website telling the browser to go to a different address.
  • redirect_uri: the parameter that carries the destination address in a redirect.
  • Remediation: the fix for a vulnerability.
  • Responsible disclosure: telling the vendor privately and giving them time to fix before details are made public.
  • SharePoint: Microsoft software that companies use to build internal sites, store documents and run small web applications.
  • Userinfo: the optional login part of a web address, placed before an @ and separated from the host name by it.
  • Validation: checking that input is acceptable before using it.
  • Whitelist: a list of values that are explicitly trusted and allowed.

More by Ozgur Alp

View all

6 more disclosed reports, best first.

More from Microsoft

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Open redirect

The lesson behind this report.

A trusted site forwards users to any address an attacker picks; rarely paid alone, often the missing link in a chain.