Facebook has revealed a security breach affecting 90 million users and says it’s too early to tell if any information was “misused or accessed”.

Guy Rosen, Facebook’s VP of product management, said the vulnerability had now been fixed and that the company had informed law enforcement.

“It’s clear that attackers exploited a vulnerability in Facebook’s code that impacted ‘View As’, a feature that lets people see what their own profile looks like to someone else,” Rosen said.

“This allowed them to steal Facebook access tokens which they could then use to take over people’s accounts.

“Access tokens are the equivalent of digital keys that keep people logged in to Facebook so they don’t need to re-enter their password every time they use the app.”

As a result of the breach, Facebook has reset the tokens of almost 50 million accounts, and in a “precautionary step”, a further 40 million accounts that used the View As feature in the past 12 months have also had their tokens reset.

“As a result, around 90 million people will now have to log back in to Facebook, or any of their apps that use Facebook Login,” Rosen said, adding that if any further affected accounts were found, they too would have their access tokens reset.

Rosen said there was no need for anyone to change their passwords.

The View As feature has been temporarily disabled as a security review is undertaken.

Facebook VP Engineering, Security and Privacy, Pedro Canahuati, said the vulnerability was the result of the interaction of three bugs.

“First, View As is a privacy feature that lets people see what their own profile looks like to someone else. View As should be a view-only interface. However, for one type of composer (the box that lets you post content to Facebook) — specifically the version that enables people to wish their friends happy birthday — View As incorrectly provided the opportunity to post a video.

“Second, a new version of our video uploader (the interface that would be presented as a result of the first bug), introduced in July 2017, incorrectly generated an access token that had the permissions of the Facebook mobile app.

“Third, when the video uploader appeared as part of View As, it generated the access token not for you as the viewer, but for the user that you were looking up.

“It was the combination of these three bugs that became a vulnerability: when using the View As feature to view your profile as a friend, the code did not remove the composer that lets people wish you happy birthday; the video uploader would generate an access token when it shouldn’t have; and when the access token was generated, it was not for you but the person being looked up.

“That access token was then available in the HTML of the page, which the attackers were able to extract and exploit to log in as another user.

“The attackers were then able to pivot from that access token to other accounts, performing the same actions and obtaining further access tokens.”