Index investors aren't exposed to IPOs, since the common indexes (SPX etc) don't include IPOs (and if you invest in a YOLO index that does, that's on you).
Also:
> The US led a sharp rebound, driven by a surge in IPO filings and strong post-listing returns following the Federal Reserve’s rate cut.
VTI and VT, two of the largest index funds, DO invest in unprofitable companies.
And for the rest (SP 500 etc), these companies are going to fake profits using some sort of financial engineering to be included.