*313OPINION OF THE COURT
Sullivan, J. P.Plaintiff Janet Chang, a 25% holder of the common stock of 207 Second Avenue Realty Corp., commenced this stockholder’s derivative action against defendants Wilson Chang and Ruby Chang, shareholders, directors and officers in charge of the corporation’s affairs, and Thomas Cartelli, who acted as 207’s attorney since 1979, when it was first incorporated. Plaintiff and her late husband had each become a shareholder in 1979 in exchange for a $5,000 contribution each, made in response to a family plea to help the defendant Changs, her now-deceased husband’s brother and his wife. The purpose of the corporation was to purchase the buildings known as 207 Second Avenue, a five-story building on Second Avenue and an attached, smaller two-story structure on East 13th Street, and allow Wilson Chang to operate his restaurant, The Dumpling House, on the first floor, which, until then, he had occupied pursuant to a lease. In exchange for their cash contribution, plaintiff and her late husband became equal shareholders in the newly formed 207, with defendants Wilson and Ruby Chang each receiving the same amount of shares, five. The shares were distributed by defendant Cartelli, who incorporated the new corporation.
In her complaint, plaintiff alleges that defendants fraudulently altered 207’s corporate records, thereby diluting the equity interest of her and her late husband (first cause of action); that defendants caused unauthorized additional shares of stock to be issued to Wilson and Ruby Chang (second cause of action); that Wilson and Ruby Chang secured two bank loans for 207, most of the proceeds of which they used for their own personal benefit and, without lawful corporate authorization, mortgaged 207’s assets (third cause of action); and that they breached their fiduciary duty, engaged in self-dealing, placed themselves in a conflict of interest and used 207 for their own personal benefit by, inter alia, unlawfully entering into an option agreement to extend The Dumpling House lease for another 10 years (fourth cause of action). In her fifth cause of action, plaintiff demanded an accounting of the proceeds of the two bank loans for which mortgages were placed against 207’s building.
It is conceded that plaintiff has had nothing to do with the running of the 115-year-old building at 207 Second Avenue and the adjacent structure on 13th Street, not even at the *314time the property was completely gutted by fire in 1983. Nor has she contributed any further capital since the original $5,000 investment. She commenced this lawsuit on January 30, 1986, shortly after borrowing $10,000 from 207.
By order dated August 22, 1990, the IAS Court severed the fifth cause of action and referred it to a Referee to hear and report on the accounting and to supervise any necessary discovery which might be required with respect to such proceeding. A hearing was held before the Special Referee over a period of four days. Both plaintiff and the Chang defendants testified. Defendant Cartelli, representing the Changs at the hearing although not on the motion to confirm, made an unsworn statement, which the Referee took as evidence, regarding the issuance of certain stock certificates. Numerous exhibits were received. Without objection from defendants’ counsel, the Referee delved far and wide into the various business dealings of 207 and the defendant Changs’ management of it.
In a lengthy report, the Referee found that the Wilson Changs, aided and abetted by Mr. Cartelli, fully controlled the operations of 207, in the course of which they, inter alia, in violation of their fiduciary duty, encumbered the buildings with unauthorized mortgages and wrongfully diverted the loan proceeds to their own use; that Wilson Chang, in his own name, subleased commercial space in the buildings, diverting the income to his own purposes; that the Wilson Changs never paid rent on their second floor apartment; that they ceased paying rent for The Dumpling House in approximately 1981, long before it ceased doing business, and thereafter leased the restaurant premises to another operator at an increased rent, keeping the rental income for themselves. In accordance with her findings, the Referee determined that the following sums had been diverted: $168,480 in rent and security for the restaurant and basement areas; $59,000 in rent from the second floor apartment; $237,758.88 in rent from the remaining apartments and proceeds from mortgage loans; and $94,200 in rent from the laundromat space in the smaller building.
The Referee further found that when additional funds were needed to close the purchase of 207 Second Avenue, plaintiffs late husband and the Wilson Changs each lent the corporation additional funds and that thereafter, on June 29, 1979, additional stock certificates were issued, two shares being allocated to plaintiffs late husband, four shares to Ruby and two *315shares to Wilson Chang. On the basis of inconsistencies in Ruby Chang’s testimony and a statement by Mr. Cartelli taking full responsibility for written write-overs on each of the certificates as to the dates and number of shares recorded thereon, the Referee recommended that these certificates be cancelled and that plaintiff be declared the owner of 25% of 207’s shares.
On the motion to confirm the Referee’s report and recommendations, the IAS Court held that defendants, by their failure to object to plaintiff’s examination of the Wilson Changs on the alteration of the subsequently issued stock certificates and the unsworn statement by defendant Cartelli, their attorney, as to his role in the alteration — "For the record, it’s my handwriting. I wrote up[,] I prepared all the stock” — had waived any objection to the Referee’s consideration of the stock ownership issue and had, in effect, consented to extend the scope of the reference. It amended the order of reference accordingly. After a review of the record and Referee’s report, the court held that the findings as to the issue of 207’s stock ownership, with respect to the Wilson Changs’ diversion of the corporation’s funds, were amply supported by the evidence. The court adopted the Special Referee’s recommendations, including one for the appointment of a receiver. In opposing confirmation, the Chang defendants argued that the hearing was tainted by the fact that Cartelli, a defendant himself, in violation of Code of Professional Responsibility DR 5-101 and 5-102 (A) (22 NYCRR 1200.20, 1200.21 [a]) had represented all the defendants. The Changs also argued that the attorney had refrained from presenting evidence on the erroneous belief that a settlement was imminent. The IAS Court rejected both arguments, finding that while a conflict of interest existed which would preclude attorney Cartelli from representing his codefendants at a liability trial on the first four causes of action, no such conflict existed as to the fifth cause of action for an accounting, since Cartelli never received any corporate assets and therefore could not be liable under that cause of action. The court also found that the Changs had a full and fair opportunity to present their evidence.
On appeal, the defendants Chang maintain, inter alia, that the Referee’s report and recommendations were a nullity because they exceeded the scope of the order of reference which, as pleaded in the fifth cause of action seeking an accounting, the subject of the reference, was limited to the disposition of the proceeds of the two mortgage loans totalling *316$321,000. Absent consent or special circumstances, they argue, citing Sheean v Allen (19 AD2d 595), there is no authority for expanding a Referee’s jurisdiction. The Changs also argue that 207 was created solely for the family purpose of providing Wilson Chang with a favorable lease with which to run his restaurant. In this regard, they argue, the capital contributions of plaintiff and her late husband should be viewed as a loan with the shares of stock which they received therefor representing collateral. Thus, they challenge the Referee’s findings that they diverted over $200,000 of corporate funds, that they did not have the right to occupy the second floor apartment rent free in exchange for their services, that Wilson Chang’s interest in the laundromat be forfeited on the ground that his investment therein was an opportunity which should have been offered to 207, and that they are barred, as a matter of law, from receiving compensation as a result of their disloyalty.
None of these issues need be reached, however, since we find, as argued, that the representation of the defendant Changs by Mr. Cartelli, a codefendant, in violation of the canons of ethics, irreparably tainted the proceedings. Cartelli had an irreconcilable and hopeless conflict of interest. The complaint charged him with acts in furtherance of a scheme to defraud and loot 207. He is alleged to have been the incorporator of and, at all times pertinent, the attorney for the corporation as well as the personal attorney of the Wilson Changs. The complaint charges that since the death of plaintiff’s husband, the defendant Changs, aided and abetted by Mr. Cartelli, have falsely, illegally and fraudulently altered corporate records and fraudulently issued stock, which, by false and fraudulent representations, they have attempted to disguise. The complaint also challenges the bona tides of the mortgages and 15-year lease options, in both of which transactions defendant Cartelli was the attorney.
While recognizing the existence of a conflict of interest between Cartelli and his codefendants with respect to the first four causes of action, the IAS Court nonetheless rejected the argument with respect to the fifth cause of action because "it is clear no such conflict could have tainted the hearing regarding the accounting.” In so ruling, the court failed to recognize that Cartelli represented his codefendants on what was, in fact, a full trial on the first four causes of action. Without notice to anyone or authority, the Referee took testimony on each of those causes of action and proceeded to render findings *317so comprehensive as to grant almost every item of relief sought in the complaint. The order on appeal confirming the Referee’s report reflects this fact; it does not direct any further hearing on any issue and, by appointing a receiver, ousts the Chang defendants from control of the property known as 207 Second Avenue. Notwithstanding the far-reaching import of the Referee’s findings and recommendations, which, to all intents and purposes, disposed of the entire case, the IAS Court sanctioned Mr. Cartelli’s representation of his codefendants on the premise, clearly erroneous, that only the accounting claim had been determined.
In any event, assuming the IAS Court’s factual conclusion to have been correct, the reasoning underlying that ruling, that since Cartelli never received any corporate assets he did not have a conflict of interest, was itself flawed. Whether a lawyer has a conflict of interest is not dependent on the outcome of the factual question at issue. It is the integrity of the fact-finding process itself that is protected by the ethical guidelines governing attorneys, which require independent and vigorous representation of a client’s interests.
As a defendant himself, Mr. Cartelli was in a hopelessly compromised position. He had represented the corporation in all the complained-of transactions. He was exposed to the possibility of a finding of professional malpractice or being part of a scheme to defraud. A finding against his own clients, the Changs, even as to the fifth cause of action, might well exonerate him of all liability. In fact, as noted, it was Cartelli’s exoneration upon which the court relied in upholding his representation of the Changs in the face of an apparent conflict. DR 5-101 (A) of the Code of Professional Responsibility (22 NYCRR 1200.20 [a]) prohibits a lawyer, except with the client’s consent after full disclosure, to accept employment if the exercise of his professional judgment on behalf of the client will or may reasonably be affected by the lawyer’s own financial or personal interests. There is no indication in this record that the Changs were aware of their legal rights. An attorney "may not allow his own interests to conflict with those of his client. To hold otherwise would be to ignore the overriding public interest in the integrity of our adversary system.” (Greene v Greene, 47 NY2d 447, 453.)
As a further indication of the inconsistency of the IAS Court’s ruling, it held that, notwithstanding Cartelli’s conflict of interest in representing the Changs at trial on the first four causes of action, his failure to object to plaintiff’s questioning *318of the Changs on matters pertaining to the first and second causes of action waived the Changs’ right to enforce the limitations of the order of reference. Thus, an attorney, otherwise disqualified, was found competent, by his silence, to bind his clients to a waiver of the right to enforce the limitations of an order of reference.
In the final analysis, the court treated any impropriety arising out of counsel’s conflict of interest as "more properly a matter to be resolved among Cartelli and [the Changs].” This is, of course, no answer to the problem. Courts can never abdicate their responsibility to supervise and regulate the ethical conduct of attorneys appearing before them, especially where the rights of litigants are affected.
DR 5-101 (B) of the Code of Professional Responsibility (22 NYCRR 1200.20 [b]) prohibits a lawyer, except in circumstances not applicable here, from representing a client where "the lawyer knows or it is obvious that the lawyer ought to be called as a witness on behalf of the client.” DR 5-102 (A) (22 NYCRR 1200.21 [a]) requires that, except in the same circumstances, a lawyer withdraw if, after being retained, he learns or it is obvious that he ought to be called as a witness on behalf of the client.
In the instant case, these prohibitions have been transgressed. Mr. Cartelli was himself a named defendant against whom a number of substantive allegations were asserted. He had previously represented the corporation and the Changs with respect to the very subject matter of this lawsuit. As such, he was a necessary witness for the Changs. At the time of the hearing, he had an ongoing relationship with plaintiff in his capacity as the attorney for 207, a close corporation and family enterprise, by virtue of which he was in a position to testify as to plaintiff’s knowledge and possible acquiescence in the events at issue.
Mr. Cartelli’s cross-examination of plaintiff illustrates the wisdom of the prohibition. At one point, an exchange about presuit contact between the witness and Cartelli deteriorated into an argumentative dialogue about who said what. Where an attorney representing a party was an active participant in a disputed transaction and has personal knowledge of the underlying circumstances, he ought to be called as a witness on behalf of his client and it is improper for him to continue his representation. (Hitzig v Borough-Tel Serv., 108 AD2d 677; see, Hempstead Bank v Reliance Mtge. Corp., 81 AD2d 906.) *319Since the test under both DR 5-101 (B) and 5-102 (A) (22 NYCRR 1200.20 [b]; 1200.21 [a]) is whether an attorney "ought to be called”, the parties’ intentions are not determinative. (S & S Hotel Ventures Ltd. Partnership v 777 S. H. Corp., 122 AD2d 676, 677-678; Zweig v Safeco Ins. Co., 125 AD2d 205.)
The prohibition against an attorney representing a client in a matter in which it is obvious, as here, that the attorney ought to be called as a witness is so strong as to bar the attorney from the recovery of a legal fee for any services rendered. (Brill v Friends World Coll., 133 AD2d 729.) Any doubts as to the existence of a conflict should be resolved in favor of disqualification. (Flushing Sav. Bank v FSB Props., 105 AD2d 829; Narel Apparel v American Utex Intl., 92 AD2d 913.) An attorney must not only avoid impropriety but even the mere appearance thereof. (Greene v Greene, 47 NY2d, supra, at 451; Cardinale v Golinello, 43 NY2d 288, 296; see, Code of Professional Responsibility Canon 9.)
Where attorney impropriety is apparent, a court, whose power in this regard emanates from its control over attorneys appearing before it, has an obligation to act to protect the client in order to preserve the integrity and honor of the judicial system. (Cf, Matter of Moxham v Hannigan, 89 AD2d 300, 302.) Both the parties to an action and the public at large are entitled to protection against even the appearance of impropriety. (Flushing Sav. Bank v FSB Props., 105 AD2d, supra, at 831.) In our view, Mr. Cartelli’s representation of the Changs in the circumstances presented irreparably tainted the proceedings and warrants the setting aside of the hearing and the report and recommendations.
In addition to his conflict problem in representing his codefendants, the Changs, Mr. Cartelli failed to limit the scope of the hearing to the issues submitted to the Referee, whose jurisdiction does not extend to matters which are not part of the order of reference. (See, CPLR 4311; Feder Corp. v Bozkurtian, 48 AD2d 701.) Absent the consent of the parties or special circumstances warranting such action, there can be no extension of the scope of the reference. (Sheean v Allen, 19 AD2d 595, supra; see also, 4 Weinstein-Korn-Miller, NY Civ Prac ¶ 4311.03.) A Referee who attempts to resolve a matter beyond the scope of the reference acts in excess of his or her jurisdiction. (McCormack v McCormack, 174 AD2d 612.)
The fifth cause of action, which was the subject of the reference, raised only one issue, i.e., the disposition of some *320$321,000 in net proceeds from two mortgage loan transactions. The Referee, without explaining how much of the gross amount represented diverted loan proceeds and how much represented diverted rents, found that $237,758.88 in mortgage and rent proceeds had been diverted. That determination should have terminated the reference. Instead, the Referee made a general inquiry into the value and disposition of 207’s assets allegedly diverted by the Chang defendants. The IAS Court was of the view that the fifth cause of action required such a general inquiry.
The Changs’ alleged self-dealing concerning the restaurant and laundromat leases were not part of the reference; the Referee was never authorized to adjudicate a claim for rescission of The Dumpling House lease or to recommend rescission of Wilson Chang’s acquisition of the grocery/laundromat lease, which the complaint does not even challenge. Yet on this last transaction, the Changs have been found to owe $94,200. Nor was the dispute over the Changs’ occupancy of the second floor apartment part of the reference.
These findings had nothing to do with the accounting of mortgage loan proceeds sought in the fifth cause of action and should have been treated as a nullity. (See, e.g., Speciale v Sciascia, 263 App Div 901.) In that regard, the IAS Court erred in ruling that Cartelli waived any objections the Changs might have had to the Referee’s expansion of the scope of the reference to include the first (alteration of corporate records) and second causes of action (improper issuance of stock). Absent some notice that the scope of the reference was being expanded, there cannot be a waiver. "The right to trial in due course is too vital to be deemed waived by implication.” (Feder Corp. v Bozkurtian, supra, 48 AD2d 701.) Thus, apart from the conflict in the attorney-client relationship, which tainted the entire reference, to the extent that the Referee considered any issue other than the accounting sought in the fifth cause of action, her findings and recommendations are a nullity.
Accordingly, the order of the Supreme Court, New York County (Diane A. Lebedeff, J.), entered on or about July 30, 1992, which, inter alia, confirmed the report of the Special Referee, should be reversed, on the law and on the facts, without costs or disbursements, the motion to confirm denied and the matter remanded for a new hearing in accordance with the order of reference.
Carro, Wallach and Kupferman, JJ., concur.
*321Order, Supreme Court, New York County, entered on or about July 30, 1992, which, inter alia, confirmed the report of the Special Referee, is reversed, on the law and on the facts, without costs or disbursements, the motion to confirm denied and the matter remanded for a new hearing in accordance with the order of reference.