Unions and the hotel industry joined forces to convince New York lawmakers to pass the nation's strictest regulations for room-sharing, but the new law seems to stand on shaky legal ground and is already facing a lawsuit.

"New York is heading straight for the buzz-saw of federal law," says Berin Szoka, president of Tech Freedom, a nonprofit technology policy organization.

The new law, signed a week ago by Gov. Andrew Cuomo, would impose fines of up to $7,500 for advertising rentals with a term of less than 30 days. Technically, those rentals were already illegal—the state had already banned rentals of less than 30 days back in 2010—but the new law is a direct attack on websites like Airbnb and other room-sharing services that connect would-be renters with hosts.

The problem, says Szoka, is that federal law already bars states from doing exactly that. In the Communications Decency Act of 1996, Congress prohibited states from holding online platforms responsible for the speech of their users.

"That safe harbor has been vital for the development of Internet services," he says. "Yet it seems state legislators keep forgetting it exists. That means we keep going round and round the merry-go-round of illegal legislation and pointless litigation."

That interpretation will be tested in court again. Hours after Cuomo signed the law on Friday, Airbnb sued New York over it. The state says it will not enforce the law until the suit is settled.

In its lawsuit against New York, Airbnb argues that the law will impose "irreparable harm" that would stretch beyond the borders of a single state. The lawsuit says it's not clear whether hosts or the online platform would be liable for fines issued under the law.

"In order to be assured of avoiding liability, including potential criminal prosecution, Airbnb would be required to screen and review every listing a host seeks to publish," the lawsuit contends, according to the New York Times.

In a statement, Airbnb said Cuomo was rewarding a special interest—"the price-gouging hotel industry"—at the expense of thousands of New Yorkers who use Airbnb.

The ban could also be challenged on First Amendment grounds, since courts have long held that the U.S. Constitution protects commercial speech as long as it's not fraudulent or criminal.

As I wrote in June when the law was passed by the state legislature, the state might have found a way to get around federal protections for free speech in this instance. Since short-term rentals were already illegal, New York could argue that it's not limiting free speech but rather targeting speech that serves criminal purposes—even if it's absurd that anyone renting an extra bedroom in their home could be considered a criminal.

It's a tenuous argument, but it's probably the only way the New York law will survive a First Amendment challenge. It also has frightening implications. If policymakers are allowed to make an end-run around free speech by making the subject matter of that speech illegal, it could give politicians an incentive to push for more over-criminalization as a means to further restrictions on speech. That's a nasty combination.