The selfie was the first thing to go viral.

Stefan Grant posted it to Twitter last October, a brightly lit image of him grinning into the camera alongside another young black man with a broad smile and two thumbs up. Behind them are trees, the outline of a house, and a pair of policemen, also smiling. ”Yo!” the caption reads. “The Air B&B we’re staying at is so nice, the neighbors thought we were robbing the place & called the cops!”

It wasn’t long until more details emerged. Grant, who raps and produces under the name “StefIsDope,” was visiting Atlanta to play a show at the A3C Music Festival & Conference. He and four of his friends had booked a place to stay on Airbnb, a quiet suburban home with granite kitchen countertops and an expansive backyard. They’d been there a day when the police showed up: A neighbor had noticed the group hanging out and reported a robbery underway.

Certain things are ready-made for internet outrage, and white-neighbor-in-nice-suburb-calls-cops-on-black-Airbnb-guests is one of them. The story blew up in the mainstream media, while Grant’s tweet was recirculated nearly 3,000 times. Airbnb offered the group free future bookings. A month later, it flew Grant and his friend, Ronnia Cherry, to Airbnb headquarters in San Francisco to discuss discrimination.

Grant says they talked about ways to make people of color feel more welcome on Airbnb, but the conversations never really went anywhere. A few follow-up emails, then nothing. ”I think because the story had kind of died down a little bit, they thought it would just go away on its own,” Grant says. “But we told them, hey guys, our story isn’t an isolated case. It has happened, it is happening, and it will happen again. And it will probably get worse.”

His warning was prescient. In late May, Airbnb was sued in US district court by Gregory Selden, a 25-year-old black man, for racial discrimination. In the weeks since, stories of discrimination on the home-sharing platform have proliferated. Many are being shared on Twitter using the hashtag #AirbnbWhileBlack, but the allegations aren’t limited to race. Shadi Petosky, a trans woman, tweeted earlier this month that an Airbnb host denied her a reservation last year after she revealed her gender.

Airbnb is no stranger to conflict. It is frequently accused of sidestepping hospitality laws by the hotel industry, which sees its home rentals as a growing business threat. It has clashed with entire cities on matters of data sharing, affordable housing, and short-term rental regulations. In such situations, Airbnb has proven adept at identifying common enemies—from hotel lobbyists to city policymakers—and mobilizing its vast base of users and hosts against them. Home-sharing, the company likes to say, ”is both a community and a movement.”

Discrimination is different. It pits Airbnb hosts against Airbnb guests. It creates situations that are legally and ethically ambiguous, because most hosts aren’t professional hoteliers, but rather individuals choosing to rent out their private homes. It suggests that—contrary to all branding—the Airbnb community perhaps isn’t so diverse, and its home-sharing movement not really for everyone.

Airbnb has publicly condemned discrimination, but fixing it is much tougher. It can’t be debunked like a hotel industry report or lobbied away like restrictive rental regulations. Unlike any problem Airbnb has faced before, discrimination is poisoning the platform from within.

Gregory Selden first tried Airbnb last March while planning a weekend trip to Philadelphia. He downloaded the company’s mobile app, and created a profile with a headshot and standard personal details: name, education, sex, age, and residential area. He found a rental in Philly that was listed as free during his visit, and sent off an inquiry. The Airbnb host, “Paul,” wrote back saying the place wasn’t available.

In the legal complaint Selden filed last month, he alleges that shortly after being turned down by Paul, he came across the listing on Airbnb again, where it still appeared as available. Selden decided to test something out. He made two more Airbnb profiles, one named “Jessie” and the other “Todd.” Jessie was similar to Selden in his personal details. Todd was an older man. Both were white.

Using the imitation profiles, Selden sent off two new requests to Paul for his rental during the same dates. Paul, according to the complaint, accepted each fake inquiry ”immediately.”

Selden’s account, as told in court documents, is strikingly similar to a study (pdf) conducted by three researchers at Harvard last year that documented ”widespread discrimination against African-American guests” on Airbnb. In their experiment, the researchers created 20 Airbnb user profiles, sans photos, that were identical except for their names. Ten accounts were given “distinctively African-American names” and 10 “distinctively White names.” Within each group, five were male, and five female.

Over the course of July, the researchers sent 6,400 messages from these 20 accounts to hosts on Airbnb, each asking about rental availability during a specific weekend in September. They found that roughly 50% of inquiries from guests with white-sounding names were accepted, versus only 42% of those from guests with black-sounding names. White, black, and even what the researchers termed “professional” hosts—meaning they listed multiple properties on Airbnb—were all less likely to accept guests with black-sounding names.

“I figured for sure the people who were operating more like a business wouldn’t care so much,” says Dan Svirsky, a co-author of the paper. “But that’s just not what we found.”

Airbnb responded to the Harvard study by saying it did not condone discrimination. “Airbnb is one of the most open, trusted, diverse, transparent communities in the world,” a spokesperson told Bloomberg. “We respond quickly to any concerns raised by hosts or guests, and we have a zero-tolerance policy for discrimination on our platform.”

How diverse and transparent is it really, though? Airbnb declined to provide information about the demographics of its hosts and guests, but third-party research offers clues. A study from the JPMorgan Chase Institute has found that people who rent out assets on “capital” platforms such as Airbnb tend to have slightly higher earnings than the typical American. The Harvard study, which sampled hosts from Baltimore, Dallas, Los Angeles, St. Louis, and Washington, DC, noted that 63% of hosts were white and only 8% black.

Home-sharing guests in the US, meanwhile, are overwhelmingly white and well heeled. Thirteen percent of white adults have booked stays on home-sharing sites like Airbnb compared to 11% of the overall population and just 5% of black adults, according to data published last month by Pew Research Center. In the highest earning bracket ($75,000 and up), 24% have used home-sharing, compared with 4% of those in the lowest (less than $30,000).

In other words, Airbnb hosts might not just be less willing to rent their properties to black people. The very socioeconomic makeup of Airbnb’s host and guest communities could be setting up the non-white and non-wealthy to be treated as outsiders.

Housing discrimination—short-term or otherwise—has a long history in the US. The Civil Rights Act of 1964 prohibits racial discrimination by inns, hotels, motels, or any other ”establishment which provides lodging to transient guests.” The Fair Housing Act makes it illegal to “refuse to negotiate for the sale or rental of, or otherwise make unavailable or deny, a dwelling to any person because of race, color, religion, sex, familial status, or national origin.”

But “sharing” economy companies like Airbnb have complicated the legal picture. These companies—Uber, Airbnb, and TaskRabbit, to name a few—like to say they are simply platforms connecting two sides of a market. Uber matches riders with drivers; Airbnb connects people in need of housing with those who have rooms to spare. Airbnb is not a traditional hotel: It doesn’t hold inventory, set prices, or tell hosts how to handle their rental exchanges. And so when Airbnb’s hosts deny guests accommodations on account of their race or gender, the question becomes whether the company can be held liable for those actions.

Here, the law is unclear. The Civil Rights Act excludes rentals in buildings with five or fewer rooms ”for rent or hire” and which are “actually occupied by the provider of such establishment as his residence.” That caveat is known as a “Mrs. Murphy” exemption because it was created for an imagined Mrs. Murphy who occupied and ran a small boardinghouse, and wanted a choice in whom she rented to. Legal scholars believe an unstated purpose of the exemption was “to shield Mrs. Murphy from close contact with African Americans.” The Fair Housing Act has a similar provision.

The vast majority of Airbnb hosts, who rent out only a single room or unit, could in theory fall under these exemptions.

“On Airbnb, you can rent the whole house or you can rent a room in the house,” says Jamila Jefferson, a law professor at University of Missouri-Kansas City who recently wrote about discrimination on Airbnb in the Fordham Urban Law Journal. “Does ‘actually occupied’ mean that the owner needs to be there at the time that the guest is there? Or, if I’m going out of town for a vacation, is it enough to say that it’s still actually occupied by me because I’m the primary resident?”

Airbnb could also seek legal protection under the Communications Decency Act, Jefferson says, which shields many internet companies from liability for user-generated content. It was famously used to defend Craigslist in a 2008 lawsuit (pdf) that alleged the online classifieds company had violated the Fair Housing Act by posting rental ads with explicitly discriminatory phrases, such as “NO MINORITIES.”

With regard to the company itself, Jefferson says you could also argue that Airbnb fills a role somewhere between hotel and real estate broker. It doesn’t directly run any single host’s business, but it does bring them together at conferences and through organizing efforts. The more involved Airbnb is in its hosts’ affairs, the more likely it is to be held to the same anti-discrimination standards as a hotel.

In July 2014, Airbnb rebranded with a new slogan, “belong anywhere,” and a new logo, the bélo, that it introduced as a “symbol of belonging.” The unveiling was feel-good schmaltz at its finest. “Today, so much of the way we travel has been mass-produced and commoditized,” the company wrote in a blog post. “Airbnb is just the opposite. We’re a community of individuals … powered by people of all different backgrounds and beliefs.”

Airbnb has built its reputation—not to mention a $25 billion valuation—by selling this message, one of trust and inclusivity. Discrimination is just the opposite, and the company wants nothing to do with it. “Home sharing is succeeding because so many people from diverse backgrounds are having the positive experience of being welcomed into a person’s home and allowed to belong anywhere,” Nick Papas, an Airbnb spokesman, writes in an email to Quartz. “While a negative experience is rare, even one is one too many.”

In recent months, Airbnb has banned several hosts who were explicitly racist or transphobic. But subtle biases can be equally insidious and far trickier to manage. Airbnb says it is holding ”unconscious bias training” for hosts, and teaching customer service agents to ”identify and combat hosts who may be inappropriately refusing to share their space with certain guests.” It’s also conducting “an extensive review” of how hosts and guests interact. In early June, the company brought on Laura Murphy, a former director at the American Civil Liberties Union, to help lead its anti-discrimination efforts.

“We continue to encourage everyone who shares our commitment to fighting discrimination—whether it be explicit racial discrimination or unconscious racial bias—to tell us what they think,” Papas writes. ”We don’t have all the answers.”

Perhaps Airbnb should do something more radical, but the company’s middleman position puts it in a bind. If Airbnb creates strict rules for when and why rental inquiries can be declined, it risks alienating hosts. If it does too little and fails to curb discrimination, it could taint the brand and lose guests. Airbnb prides itself on being open, inclusive, and global. But in reality the people using its platform, at least in the US, tend to be wealthier and white. When the Stefan Grants and Shadi Petoskys of the world turn to Airbnb for accommodations, the odds of “belonging anywhere” are stacked against them.

Already, frustrated users are looking for other options. Grant is working with Ronnia Cherry, the friend who accompanied him to Airbnb headquarters last fall, on Noirbnb, a home-sharing site that is branding itself ”the future of Black travel.” Rohan Gilkes, a black man who has written about being rejected on Airbnb, has started a similar website called Innclusive (until very recently, “Noirebnb” with an “e”).

Petosky, for her part, has grown disillusioned with home-sharing. When she contacted Airbnb last summer about her reservation having been declined on the basis of gender, Petosky says the support team wrote back once to ask for more details, then stopped responding. After her tweet about the experience went viral, Petosky says Airbnb reached out to her to reiterate that it took discrimination seriously. “It really felt like lip service,” she says. “They didn’t even send a fruit basket.”

What Airbnb did do was make a highly public show of removing the offending host from its platform.

“That wasn’t even what I was looking for,” Petosky says. “I’m not trying to get people’s income lost. I want them to take responsibility for understanding that they shouldn’t discriminate.”

In the meantime, she’s switching back to hotels.