The defendant Ellenville Savings Bank granted plaintiffs a mortgage in the sum of $15,000 in October, 1965 secured by premises in the Town of Bethel, Sullivan County. The plaintiffs defaulted in November, 1967 and in February, 1968 the bank commenced an action of foreclosure. On August 22, 1968, during the pendency of the foreclosure action and prior to the entry of judgment of foreclosure and sale, the building on the premises was destroyed by fire. The building was covered by fire insurance and the policy contained the standard New York State mortgage clause in favor of the defendant bank. A judgment of foreclosure and sale was entered on January 2, 1969. The terms of sale, read by the referee, included a statement to the effect that if the mortgagee did not bid in the property at the sale it would assign to the purchaser such proceeds of insurance as might be payable to it by reason of the fire loss. At sale, the defendant bank-mortgagee was the sole bidder and purchased the property for *180the exact amount of the mortgage debt, together with costs and interest. There was not, as there could not be, a deficiency judgment.
These facts raise for review the dual questions of (1) whether the bank-mortgagee retained an insurable interest after it purchased the property for the full amount of the mortgage debt, and (2) the right of plaintiffs mortgagors to maintain this action after they settled their claim against the insurance carrier for less than their full loss.
The Court of Appeals in Whitestone Sav. & Loan Assn. v Allstate Ins. Co. (28 NY2d 332) has made it clear that when a mortgagee bids in the full amount of the secured debt at the foreclosure sale it loses any insurable interest entitling it to sue on a fire insurance policy under a mortgagee loss payable clause (id. at p 333). This conclusion is based on the pragmatism that the mortgagee has received a full return on its loan and the mortgage is discharged. Thereafter, the mortgagor or subsequent lienors, if any, are entitled to recover for the fire loss. Defendant’s argument, posited as it is on the premise that the assignment of the insurance proceeds clause in the terms of the sale somehow preserved its right under the fire policy, is without merit. The referee has no power or authority to include such a clause in the terms of sale since it was not provided for in the judgment of foreclosure. His role is purely ministerial and any altering of the terms of sale fixed by the judgment of foreclosure is void (Crisona v Macaluso, 33 AD2d 569; Long Is. City Sav. & Loan Assn. v Suggs, 78 Misc 2d 16). To hold otherwise would be tantamount to sanctioning foreclosure procedures at variance with the mechanics set forth in section 1371 of the Real Property Actions and Proceedings Law. That statute in subdivision 3 provides that if no motion for a deficiency judgment is made, as here, the proceeds of the sale regardless of amount shall be deemed to be in full satisfaction of the mortgage debt and no right to recover any deficiency in any action or proceeding shall exist. Defendant’s interest in the fire policy was a form of security and it perished with the mortgage debt (Whitestone Sav. & Loan Assn. v Allstate Ins. Co., supra). The fact that defendant bank sustained an intraoffice loss of approximately $11,000, after it sold the damaged premises for $7,000 at a private sale, is of no consequence since its bid at the foreclosure sale, in the absence of a deficiency judgment, fixed the market price (Real Property Actions and Proceedings Law, § 1371).
*181Next, there is no impediment to plaintiffs’ right to maintain this action for unjust enrichment and/or restitution. Clearly, the defendant bank, having pruchased the damaged property for the full amount of the mortgage debt, has been made whole and would be unjustly enriched if allowed to retain the insurance proceeds. In such a case, the law implies a promise to pay the extra moneys to the person entitled to the same. No privity is required. The right of the plaintiffs to the insurance money and the duty of the defendant bank to pay over the same creates the necessary privity (Tierney v Home Title Ins. Co. of New York, 124 Misc 645, affd 215 App Div 830). The fact that plaintiffs took less than their total loss from the insurer is of no consequence since they expressly reserved their rights against the defendant bank. Since plaintiffs have demonstrated that defendant has no right to the insurance proceeds, such moneys, in the absence of other prior lienors, belong to the plaintiffs mortgagors (Whitestone Sav. & Loan Assn, v Allstate Ins. Co., supra).
The judgment should be affirmed, without costs.
Koreman, P. J., Greenblott, Sweeney and Kane, JJ., concur.
Judgment affirmed, without costs.