Two California men have filed a federal lawsuit accusing Facebook of sharing their real names and other sensitive information with advertisers in violation of the social network's own privacy policy.

The personally identifiable information was relayed in referrer headers that were sent over three months to advertisers when users clicked on banner ads, according to an amended complaint filed this week in US District Court in San Jose, California. The header, which is included in URLs that lead to an advertising webpage, shows the Facebook address the user was browsing when he encountered the ad. The information is designed to help advertisers serve content that's geared to his age, location and interests.

Following a site overhaul in February, Facebook began embedding data in the headers that included ever more user information, including in many cases the user's Facebook username, according to the complaint.

“In particular, Facebook caused referrer headers to include not just the URL of a web page a person was viewing (e.g., a person viewing the profile of Facebook user John Doe) but also confirmation of the specific identify [sic] of the person viewing a web page (e.g., that it is John Doe himself who is viewing his own profile),” the 24-page complaint alleges.

“Similar information was revealed as users browsed photos or used other Facebook functions. Clicking an ad in any of these circumstances caused the advertiser to receive the entire web address of the page the user was visiting, including the user's Facebook username.”

The complaint says that the disclosure was in violation of Facebook's privacy policy, which among other things promised the site would “never share your personal information with our advertisers.” It goes on to theorize that a gay user struggling to come out of the closet could be inadvertently outted by such a scheme.

The tell-tale headers continued until Harvard professor Ben Edelman exposed the leak in May.

The complaint alleges that the Facebook gaffe violated the Electronic Communications Privacy Act, the Stored Communications Act, and California's Computer Crime Law and Consumers Legal Remedies act. It was filed on behalf of Facebook users David Gould and Mike Robertson, and seeks class-action status so other users of the site can be included.

Facebook representatives didn't respond to an email seeking comment.

A PDF of the complaint is here. ®