If the investemnt bank issuing the index fund goes bankrupt, you lose your money - see Lehman Brothers.
You can mitigate the risk by buying from different issuers. However, the bankruptcy risks might still be too closely related; in other words: there is the risk of a domino effect of bankruptcies of investment banks in a future financial crisis.
The best thing you can do to avoid this risk is to buy many different stocks and directly mimic an index or other fund yourself. It is not necessary to do this exactly. A random proportional selection of a considerable number of stocks (40+, but the more the better) from the index or fund you want to mimic and adjusting your investment once a year should be sufficient.