This action is brought to foreclose a mortgage executed and delivered by the Standard Brewing Co., Inc., on November 28, 1956 to certain trustees under a trust indenture dated November 28,1956 and given as collateral security for the payment of $290,000 of outstanding brewery bonds. Plaintiffs are the successor trustees. Aaron Lewis and Myron Lewis are now owners of the mortgaged premises. The trust indenture, between the brewery and the trustees for such bondholders, made provision, among other things, for the issuance, payment and mortgage security of the bonds, for the foreclosure of the mortgage upon the default and defined the authority and power of the trustees. The indenture also provided that nothing therein or in the mortgage shall prevent any consolidation or merger of the brewery with any corporation, provided the lien and security of the indenture was fully preserved. The Standard Brewing Co., Inc., was later merged into the Standard Rochester Brewing Co., Inc.
On September 2,1959, Myron Lewis submitted an installment offer in the amount of $175,000 for the purchase of the mortgaged premises and fixtures and equipment located therein, which was accepted by the Standard Rochester Brewing Co., Inc., on September 3, 1959. To date the sum of $135,000 has been paid to the Brewing Co. thereon. The contract was contingent upon the written acceptance and approval of the trustees and they expressly consented to its terms and conditions. One of the contract conditions provided that the sale was subject to the lien of the trust mortgage, until payment in full of the purchase price was made to the Standard Rochester Brewing Co., Inc. and 1 ‘ upon the payment of the full purchase price at any time, the corporation and the trustees under said Mortgage Indenture agree to discharge said mortgage.”
The defenses in this action are keyed to the consent of the trustees to the terms of the realty contract, their agreement to deliver a release of the mortgage to the purchasers upon payment of the purchase price, the payments made under the real estate contract, and the conduct of some unnamed individual bondholders, beneficiaries of the trust, who allegedly participated in, approved and ratified the transactions and accepted the benefits therefrom.
The authority of the trustee is subject to any limitations imposed by the trust instrument (EPTL, § 11-1.1, subd. [b], par. [8]) and every act in contravention of the trust is void. *428(EPTL, § 7-2.4.) Section 20 of the trust indenture granted to the trustees the power to release from the lien of the mortgage, all or any portion, of the mortgaged real property, “ provided, in the opinion of ‘ Trustees ’ same can he done without prejudice to the security herein provided for the bondholders.” In this case the mortgage constituted the only security provided in the indenture for the bondholders and the consent of the trustees to discharge the mortgage without any provision for payment or substitution of security, constituted a dissipation of the entire security, all in contravention of the trust indenture, is beyond the powers of the trustees and accordingly is void. (Kaufman v. Flagg Corp., 227 App. Div. 98.) Illegal acts of trustees are not binding on their successors. (First Nat. Bank v. National Broadway Bank, 156 N. Y. 459.)
The sum of $135,000 already paid for the purchase of the real property and the $40,000 balance still owing is to the benefit of the brewery or its successor or representatives and not to the trust. Any payments made by the purchaser or his successors to the brewery or its successor, created no trust payment for the benefit of the bondholders or constituted the brewery or its successor the agent of the trustees for the purpose of receiving payment. (Ehag Eisen. Holding AG v. Banca Nat. A. Romaniei, 306 N. Y. 242, and cases cited.) There is no proof nor is it contended that any payment was made by the brewery to the trustees according to the terms of the mortgage. Accordingly, defenses set forth in the answers ‘ ‘ Second ’ ’ through ‘ ‘ Fifth ’ ’ and paragraph 25 which are related to offer of judgment, payment, tender, release or subordination, and all based upon the actions of the trustees in consenting to terms beyond the authority conferred upon them, and to the payments made by defendants pursuant to the realty contract, are insufficient as a matter of law, raise no triable issue of fact and are dismissed.
The “First Partial” and the “Sixth” and “Seventh” affirmative defenses which allege the equitable defenses of estoppel and waiver on the part of plaintiffs, and estoppel, ratification, unjust enrichment, laches and unclean hands of some unnamed individual bondholders require further consideration. It is the claim that certain individual bondholders participated in and approved the sale of the mortgaged property and by such consent these bondholders are now precluded or estopped from claiming a breach of the trust for such acts of the trustees and are guilty of la'ches and unclean hands, which should bar them from the benefits sought by the trustees in foreclosing the *429mortgage. It is their further claim that if the trustees are permitted to foreclose the mortgage on behalf of all bondholders, those who participated in or approved and ratified the acts of the trustees will be unjustly enriched and thus the moving defendants could be held liable for a larger mortgage debt than should equitably be charged against them. The moving defenddants, owners of the premises, contend that the complaint should be dismissed in the absence of these blameworthy bondholders, or in the alternative that such bondholders be made parties to this action, either as plaintiffs or defendants. None of the parties to the action are identified as bondholders nor is the identity of such alleged censurable bondholders otherwise disclosed by the pleadings or moving papers.
The necessary parties to a foreclosure action are those whose interest is claimed to be subject and subordinate to the plaintiffs’ lien, such as the record owner or person having an estate or interest in the property or one holding a later lien. (Real Property Actions and Proceedings Law, § 1311.) Proper parties may be those claiming a lien paramount to the mortgage, so that the purchaser at the sale may know the extent of the outstanding encumbrance, or the persons affected where it is sought to declare such lien to be subordinate, or to obtain a deficiency judgment or a determination to define the liens to which the property may be subject. A judgment cannot affect a proper party who has been omitted from the action, and it is not res judicata as to persons not parties to the action. The right of the court to order a party brought in is not limited to persons who are strictly necessary and indispensable. This may include persons who are so connected with the subject matter of the controversy that it is necessary to have them before the court for the proper protection of those whom the decree will necessarily and directly affect. (2A Warren’s Weed, New York Law of Real Property, § 6.17.)
Sections 23 and 27 of the trust indenture here specifically provide that no holder of any bond shall have the right to institute any action in equity or at law for the foreclosure of the lien of the mortgage or for any other remedy. It is well settled that the beneficiary of a trust is not the real party in interest to bring an action in relation to trust property, unless it is alleged and proved that the trustees refused to foreclose the mortgage on the demand of the bondholders. In such case the trustees would be made a party defendant. (Levy v. Carver Fed. Sav. & Loan Assn., 18 A D 2d 1062; cf. Ettlinger v. Persian Rug & Carpet Co., 142 N. Y. 189.) The trustees here alone *430possess the authority to take appropriate judicial proceedings for the enforcement of the rights of the bondholders, (Greene v. New York United Hotels, 236 App. Div. 647, affd. 261 N. Y. 698.) So far as plaintiffs, as successor trustees are concerned, such unidentified bondholders as beneficiaries of the trust are neither necessary nor proper parties.
This is not to say, however, that the moving defendants are without recourse. There is authority for the proposition, that when some of the beneficiaries participated in or approved illegal acts of trustees respecting the trust property, they were later estopped in an action by the trustees from claiming that such acts were done without authority, and the total claim of the trustees was reduced by the amount of the interest of such beneficiaries. (Vohmann v. Michel, 185 N. Y. 420.)
The moving defendants here should have the right to have before the court, all persons against whom they claim such equitable principles may apply and the opportunity to submit the necessary proofs thereon and on their own clean hands. Such claims may not be raised, however, as an equitable defense against plaintiffs in their respresentative capacity as trustees, who lacked the power to grant the consent in question (Vohmann v. Michel, supra, pp. 424, 425) and their lack of power to perform the act cannot be made good under any equitable principle. (Stahl Soap Corp. v. City of New York, 9 A D 2d 964.)
The burden of proof is upon these defendants, who assert these equitable defenses and claims, to show that the amount otherwise owing to the plaintiffs as trustee for such bondholders should be reduced to the extent of the holdings of such consenting bondholders. The moving defendants thus have the responsibility to name and bring in as parties to the action, in whatever capacity the CPLR may permit, the persons whom they wish to charge with such equitable claims. Because of their failure in this respect the court denies the motion of the defendants to dismiss the complaint or in the alternative to make such unnamed bondholders parties to the action, either as plaintiffs or defendants. In the interest of substantial justice, however, the court grants 20 days’ leave to such defendants to utilize any procedural methods permitted by the CPLR to bring these alleged estopped bondholders before the court in this action so that such equitable issues may be determined.
Further, based upon the foregoing considerations the “ First Partial ” and the “ Sixth ” and “ Seventh ” affirmative defenses are not properly interposable against the plaintiffs, are insuf*431ficient as a matter of law, raise no triable issue of fact and the motion of plaintiffs in this regard is granted and the defenses are dismissed. Since the moving defendants have not submitted proof by affidavit controverting the validity of the mortgage or the default, the motion of plaintiffs for summary judgment of foreclosure is also granted. It is directed, however, that the entry of judgment be held in abeyance pending a determination of the issue of priority of mortgage liens, now pending before the court in a separate application, and the action of the moving defendants with respect to the leave granted to them herein and the determination of any issues raised thereby, adjusting the amount due on the mortgage to the extent of the recovery, if any, that the defendants, Aaron Lewis and Myron Lewis, may have on their alleged equitable claims. (Merry Realty Co. v. Shamokin & Hollis Real Estate Co., 186 App. Div. 538, revd. on other grounds 230 N. Y. 316; Ivon R. Ford, Inc. v. Sutherland, 142 N. Y. S. 2d 797; Franklin Nat. Bank of Long Is. v. Be Giacomo, 20 A D 2d 797; Torre v. Zuza, 29 Misc 2d 552, and cases cited.)