ASP.NET Core Cross Site Request Forgery Vulnerabilty (CVE-2018-0785)
Web applications generated from certain ASP.NET Core project templates contained a cross-site request forgery flaw. An attacker could use it to change the recovery codes on a victim's account without consent, potentially locking the victim out permanently once their two-factor device was lost.
Originally disclosed on Microsoft
Description
A Cross Site Request Forgery (CSRF) vulnerability exists when a ASP.NET Core web application is created using vulnerable project templates. An attacker who successfully exploited this vulnerability could change the recovery codes associated with the victim's user account without his/her consent. As a result, a victim of this attack may be permanently locked out of his/her account after loosing access to his/her 2FA device, as the initial recovery codes would be no longer valid. The update corrects the ASP.NET Core project templates.
FAQ
What does the update do? The update corrects the project templates for ####. The template updates only affect new applications. For this reason, Microsoft strongly recommends that developers who have built web applications using these templates take immediate action to evaluate their web applications for exposure to the vulnerability, and then use the workarounds in the Suggested Actions section to make code changes to update their applications to protect them from the vulnerability. If you are running Visual Studio 2013, you need to use the workaround steps listed in the Suggested Actions section to update your applications manually every time you use the affected templates. How do I apply the update? Start Visual Studio. Under the Tools menu, choose Extensions and Updates. Expand the Updates tree. Under Product Updates locate the following two entries: • Microsoft ASP.NET and Web Tools • Microsoft ASP.NET Web Frameworks and Tools Select each update and click Update. Suggested Actions The following workaround information details the changes that you must make to existing applications created from the ASP.NET project templates. Visual Studio 2015 MVC 5 and Visual Studio 2013 MVC 5 For C#
ASP.NET
ASP.NET
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the project templates generated account-management endpoints that did not enforce anti-forgery token validation on requests changing recovery codes.
Impact
An attacker could change a victim's recovery codes without consent, and the victim may be permanently locked out after losing their two-factor device; the text does not describe any defence that blocked the attack.
What the attacker needed
App built from vulnerable template; victim logged in and visits attacker page
The fix
Microsoft corrected the project templates, but because the update only affects new applications, existing apps should be evaluated and patched manually using the suggested workarounds.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Cross-site request forgery is when a malicious website quietly makes your browser send a request to another site where you are already logged in, so the action looks like it came from you. Here, the starter code Microsoft shipped for new ASP.NET Core apps did not properly check that such requests were genuine, so someone could swap out your account recovery codes. If you later lost your two-factor authentication device, those old codes would no longer work and you could be locked out for good.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.