It's not illegal for you to invest in Stripe. It's simply illegal for Stripe to try and sell you their stock. If you happen to have personal connections to Stripe leadership, and they haven't hit the regulatory shareholder limit (after which they must start filing disclosures with the SEC), you could legally buy all the Stripe stock you could afford.