Uber and Lyft drivers are quietly discriminating against riders based on gender and race, a new study suggests.

In fact, Uber drivers in Boston were more than twice as likely to cancel rides of passenger who had "African American sounding" names than "white-sounding" names, the study suggested. Meanwhile, drivers also took female passengers for longer, more expensive rides.

The findings stem from a research published on Monday from professors at the Massachusetts Institute of Technology, Stanford University and the University of Washington.

The study, first reported on by Bloomberg, examined the racial and gender discrimination in ridesharing companies like Uber and Lyft. It was based on nearly 1,500 rides taken in Seattle and Boston.

The authors controlled the routes and had research assistants use identical smartphones, mobile carriers and data plans to ensure no variances. Participants captured information such as trip request and accepted time, actual pickup and drop off times.

While Lyft displays a rider's name and picture, Uber only shows the passenger's name after a driver accepts a ride request. It doesn't, however, show a rider's photo or reveal the final destination until after the rider is picked up.

Uber drivers are, however, penalized for cancellations: Each city has a maximum cancellation rate based on average cancellations in the area.

Related: Airbnb is cracking down on discrimination

"We went into this hoping that we wouldn't see anything, but we found pretty strong evidence of discrimination," study co-author Christopher Knittel, a professor at MIT Sloan School of Management, told CNNMoney.

Overall, black riders waited 30% longer overall for an UberX to arrive, the study showed. While the percentage is specific to Uber, Lyft drivers in Seattle were also slower to accept ride requests from African American males than white males.

Lyft drivers have information about a rider's identity to assess upfront before accepting a ride. This suggests discrimination could be happening before they accept a ride.

"I have no reason to think Lyft drivers are different form Uber drivers," said Knittel.

The study also revealed gender impacted travel times, too. According to the study, women were kept in the car longer -- driven a distance of 5% more -- than male passengers taking the same routes.

It's unclear why female passengers were kept in cars for a longer time, but some factors could be for social reasons or to charge a higher fare, Knittel said.

The researchers cited anecdotal evidence: "The additional travel that female riders are exposed to appears to be a combination of profiteering and flirting to a captive audience," the study said.

The research was confined to just two markets, but Knittel said discrimination is likely happening elsewhere and across related industries. For example, the study confirmed discrimination also persists in the taxi industry. In Seattle, participating riders tested out hailing traditional taxis. The first cab stopped nearly 60% of the time for white research assistants but less than 20% for African Americans.

Related: New York cracks down on Airbnb

There have been reports of discriminatory behavior on other sharing economy platforms, such as Airbnb. In 2015, a Harvard University study found Airbnb hosts are less likely to rent to guests with African American sounding names. The following year, black users claimed hosts continued to reject bookings due to race. Airbnb announced new inclusion policies in September and most recently, it sent an email requiring people to agree to its new "community commitment" to use the site.

Knittel said it's a company's responsibility to eliminate discrimination as much as possible. For example, Uber, Lyft and others could omit personal information about riders and replace photos and names with user numbers. But without those details, the relationship between driver and rider might feel impersonal.

"We realize there's a tradeoff," Knittel said

When asked for comment, Uber recognized the need to crack down on these issues.

"We believe Uber is helping reduce transportation inequities across the board, but studies like this one are helpful in thinking about how we can do even more," said Rachel Holt, Uber's head of North American operations in a statement.

Meanwhile, Adrian Durbin -- Lyft's director of policy communication -- responded to the study by highlighting its positive impact on "communities of color."

"Because of Lyft, people living in underserved areas -- which taxis have historically neglected -- are now able to access convenient, affordable rides," he said in a statement. "And we provide this service while maintaining an inclusive and welcoming community, and do not tolerate any form of discrimination."

Knittel said more transparency, such as Uber and Lyft sharing their data with researchers, could be a good place to start a conversation for greater change.