Facebook accidentally shared 6 million users' email addresses or telephone numbers due to a software bug, the company announced Friday.

The breach was caused by an unfortunate combination of Facebook's "People You May Know" and "Download Your Information" features. "People You May Know" offers friend suggestions based in part on other users' uploaded contact lists or address books; "Download Your Information" offers a downloadable version of your Facebook Timeline archive.

When some users downloaded their Facebook archives with "Download Your Information," the archive included contact information for second-tier connections with whom Facebook thought those users might want to connect but who hadn't yet received or approved a friend request from that user. Translation: Data breach.

Facebook says for every email address or phone number lost in the breach, each individual piece of information was included in an archive download "only once or twice." Facebook has no evidence there was any malicious exploitation of the bug before it was found and the service was deactivated.

SEE ALSO: How to See When Someone Unfriends You on Facebook

A security researcher found the bug and reported it to Facebook, which shared details about it on its Facebook Security page, posted in full below. Facebook says it's notifying government regulators to the problem.

All affected Facebook users will be notified via email. Have you received an e-mail about the data breach from Facebook? Are you concerned about the breach? Tell us in the comments.

At Facebook, we take people’s privacy seriously, and we strive to protect people’s information to the very best of our ability. We implement many safeguards, hire the brightest engineers and train them to ensure we have only high-quality code behind the scenes of your Facebook experiences. We even have teams that focus exclusively on preventing and fixing privacy-related technical issues before they affect you. Even with a strong team, no company can ensure 100% prevention of bugs, and in rare cases we don’t discover a problem until it has already affected a person’s account. This is one of the reasons we also have a White Hat program to collaborate with external security researchers and help us ensure that we maintain the highest security standards for our users. We recently received a report to our White Hat program regarding a bug that may have allowed some of a person’s contact information (email or phone number) to be accessed by people who either had some contact information about that person or some connection to them. Describing what caused the bug can get pretty technical, but we want to explain how it happened. When people upload their contact lists or address books to Facebook, we try to match that data with the contact information of other people on Facebook in order to generate friend recommendations. For example, we don’t want to recommend that people invite contacts to join Facebook if those contacts are already on Facebook; instead, we want to recommend that they invite those contacts to be their friends on Facebook. Because of the bug, some of the information used to make friend recommendations and reduce the number of invitations we send was inadvertently stored in association with people’s contact information as part of their account on Facebook. As a result, if a person went to download an archive of their Facebook account through our Download Your Information (DYI) tool, they may have been provided with additional email addresses or telephone numbers for their contacts or people with whom they have some connection. This contact information was provided by other people on Facebook and was not necessarily accurate, but was inadvertently included with the contacts of the person using the DYI tool. After review and confirmation of the bug by our security team, we immediately disabled the DYI tool to fix the problem and were able to turn the tool back on the next day once we were satisfied that the problem had been fixed. We've concluded that approximately 6 million Facebook users had email addresses or telephone numbers shared. There were other email addresses or telephone numbers included in the downloads, but they were not connected to any Facebook users or even names of individuals. For almost all of the email addresses or telephone numbers impacted, each individual email address or telephone number was only included in a download once or twice. This means, in almost all cases, an email address or telephone number was only exposed to one person. Additionally, no other types of personal or financial information were included and only people on Facebook – not developers or advertisers – have access to the DYI tool. We currently have no evidence that this bug has been exploited maliciously and we have not received complaints from users or seen anomalous behavior on the tool or site to suggest wrongdoing. Although the practical impact of this bug is likely to be minimal since any email address or phone number that was shared was shared with people who already had some of that contact information anyway, or who had some connection to one another, it's still something we're upset and embarrassed by, and we'll work doubly hard to make sure nothing like this happens again. Your trust is the most important asset we have, and we are committed to improving our safety procedures and keeping your information safe and secure. We have already notified our regulators in the US, Canada and Europe, and we are in the process of notifying affected users via email. We appreciate the security researcher's report to our White Hat program, and have paid out a bug bounty to thank him for his efforts.

Image via iStockphoto, pearleye