Presumably, it's in the contract and the contract is iron-clad.
Many years ago, I had a friend who was questioning a lawyer about a general indemnity clause in a contract. The lawyer said, "Don't worry about it too much. The courts don't like it when someone tries to take away your ability to seek legal satisfaction." I guess that has changed.