When a public officer, by official misconduct or neglect of duty, shall forfeit his official undertaking or other security, or render his sureties therein liable upon such undertaking or other security, any person injured by such misconduct or neglect, or who is by law entitled to the benefit of the security, may maintain an action thereon in his own name against the officer and his sureties to recover the amount to which he may be entitled by reason thereof.