Updated

For Uber Technologies Inc. and Airbnb Inc., New York City has been a cradle of growth, with its 8.5 million residents and burgeoning tech startup scene.

But the highflying tech firms are also finding that their biggest U.S. market is generating its own obstacles.

This week, New York has passed legislation that could hamper the Silicon Valley heavyweights at a crucial moment as they prep for potential initial public offerings expected as early as next year. Some investors and executives of the companies have privately expressed concern that New York’s restrictions could spur other cities to follow suit.

On Wednesday, despite weeks of lobbying by Uber, rival Lyft Inc. and others, the New York City Council passed a bill to freeze new issuances of ride-hailing licenses, a measure Mayor Bill de Blasio embraced.

And on Monday, Mr. de Blasio signed legislation that would require Airbnb to disclose to the city detailed information about its hosts, which could wipe out a share of listings by cracking down on illegal rentals and spooking other hosts from listing.

CALIFORNIANS ARE TOSSING THEIR ELECTRIC SCOOTERS INTO THE OCEAN, BURNING THEM

For now, the hold on new ride-hailing licenses might not be a crushing blow: The freeze is for one year. And New York is unusual in that it requires licenses, unlike other cities that let drivers simply get approved by Uber.

But New York’s latest measures show how regulation remains an immense risk to tech stars’ financial health. Roughly a decade after these companies were founded, cities around the world are still wrestling with exactly how to measure and manage their societal impact.

Click here for more from The Wall Street Journal.