(a) The official undertaking or other security of a public officer to the state, a borough, city, town, or other municipal or public corporation of like character therein is considered a security to the state or to the borough, city, town, or other municipal or public corporation, as the case may be, and also to all persons severally for the official delinquency against which it is intended to provide.
(b) When a public officer, by official misconduct or neglect of duty, forfeits the officer's official undertaking or other security or renders the sureties liable upon the undertaking or other security, a person injured by the misconduct or neglect or who is by law entitled to the benefit of the security may maintain an action thereon in the person's own name against the officer and the sureties to recover the amount to which the person may be entitled.