This question is related to Law.SE, although for a very short description I'll put it here: software, in general, is not protected by a patent. A Patent forbids individual creation, whereas Copyright just forbids copying. The differences being, a Patent usually protects a very smart but simple idea which is trivial to copy once you've seen it. A Copyright protects works which take effort to produce (hey I spend many hours to create this, you can't just copy it for your own without attributing me).
Now with the laws aside, you have to look at the contracts with your clients. For corporations that are used to contract out IT projects, one of the following is usually written in the contract:
- Client will purchase software license from vendor directly. The software will not be modified.
- Contractor will purchase software license from vendor on behalf on the client. The software will not be modified.
- Contractor delivers customized software to client.
If it is case (3), the contract will usually go on with a clause like this: "the contractor is responsible for obtaining all software licenses and should include the prices in the quotation. The contractor shall ensure that the delivered work does not infringe any copyright". So there goes your liability.
Do you need an insurance for that? I've never heard of anyone doing that, honestly. The license of software or third-party libraries (whether open-source or not) are usually clearly stated. The license agreement would indicate whether it is acceptable to use it for commercial purpose. Many developer tools would also have "Personal" and "Commercial" licenses to choose from, making the choice pretty obvious. So in the event of an infringement, it'd mostly be argued as "intentional breach of software license agreement", which I'm not sure if insurance companies would like to accept for a claim.