§ 2511. Liability of surety. Where two or more persons are surety on an undertaking in an action or proceeding, they shall be jointly and severally liable. The amount recoverable from a surety shall be determined in accordance with the provisions of section 7-301 of the general obligations law.