(CNN) -- Facebook ads are guessing whether users are gay and targeting a broad range of products to them based on the answer, according to a research study making the rounds on the internet Thursday.
The research, by the Microsoft Institute and the Max Planck Institute in Germany, has some critics saying that by pushing ads toward those users and then registering whether they respond, the system could inadvertently be outing some users on the site.
Facebook, meanwhile, questions the research and says any ad that makes assumptions about a user's sexual orientation is violating the site's rules.
For the study, researchers set up six fake Facebook accounts. Two were for males who had listed that they are interested in females, two were for females interested in males, and one each was created for a man and women interested in the same sex.
Otherwise, the profile information was identical. All were listed as 25 years old and all listed Washington, D.C., as their home.
The report says that there was a "measurable difference" in the sorts of ads that appeared on the home pages of the accounts.
About half of the ads targeted specifically to the gay male account were for gay nightclubs and other offers specifically referencing gender orientation. But significantly, they say, half were not.
As an example, they cite an ad for a nursing program at a Florida college that appeared for the gay male account, but none of the others.
The supposed lesbian account also had targeted ads that didn't appear for the "straight" female accounts, but not as many.
"The danger with such ads, unlike the gay bar ad where the target demographic is blatantly obvious, is that the user reading the ad text would have no idea that by clicking it he would reveal to the advertiser both his sexual preference and a unique identifier (cookie, IP address or email address if he signs up on the advertiser's site)," the researchers wrote.
That possibility had online commentators speculating that Facebook's algorithm could in effect "out" users to advertisers.
"[C]oming on the heels of revelations that Facebook leaked user information to advertisers through third-party apps, this latest snafu underscores how nearly impossible it is for Facebook to both profit from your personal information and to guarantee it will never be shared without your permission," blogger Adrian Chen wrote on Gawker's Valleywag tech blog.
"The collection of such information (especially when tied to something as sensitive as sexual preference) could spell disaster for a user who thinks he's being fastidious when keeping his profile private," wrote Jacqui Cheng on tech blog Ars Technica, a CNN.com content partner.
But Facebook said any advertiser that charts how a user responds to ads for future advertising use is breaking the rules.
"We explicitly prohibit them from associating that targeting detail with the data collected from the user in forms they fill out, applications they make or other interactions on their site," Facebook spokesman Andrew Noyes said.
He also said that Facebook requires targeted ads to be directly related to the information they relied upon for targeting (so, theoretically, the ads for gay bars would be allowed while the nursing-school ad would not).
"We take the privacy of our users very seriously and take action when violations of these policies come to our attention," Noyes said.
It's worth noting that the study, reported Wednesday by privacy and security blogger Christopher Soghoian, is hypothetical and based on the very small sample size of six accounts.
Also illegal under Facebook rules: Creating fake accounts.