After weeks of applying legal pressure to Donald Trump and his attorney Michael Cohen, Michael Avenatti might soon see the tables turned. Stormy Daniels’ lawyer faces the possibility of a subpoena demanding that he name the source for a report he released earlier this month on potentially corrupt payments to Cohen.

Avenatti does not appear to have a legal basis to maintain the confidentiality of his source, yet the public interest may well be served by allowing him to remain silent.

On Wednesday, the New Yorker’s Ronan Farrow published a story about an unnamed law enforcement official who reportedly leaked the information contained in Avenatti’s report. The report detailed several deposits to the bank account of Essential Consultants LLC, the same shell company Cohen used to make a $130,000 “hush money” payment on Trump’s behalf to Daniels.

The deposits came from companies including AT&T, pharmaceutical giant Novartis, and the U.S. investment arm of Russian oligarch Viktor Vekselberg, and appear to indicate that Cohen was selling access to his putative clients. All of this may also constitute evidence of other wrongdoing.

The source told Farrow that he or she took the information from a database of suspicious activity reports, or SARs, that are submitted by financial institutions to the Treasury Department. The SARs database is highly confidential, in part because it contains financial information that is subject to stringent privacy protections and because disclosure of the data can tip off potential wrongdoers during investigations.

Improper disclosure of an SAR by a government employee can be a felony, and the official who leaked Cohen’s data is highly likely to be in the crosshairs of a potential prosecution. The Treasury Department’s inspector general has reportedly commenced an investigation. Furthermore, there is good reason to question the source’s judgment in choosing to break the law by disclosing the reports.

Improper disclosure of an SAR by a government employee can be a felony.

The source told the New Yorker that he or she leaked the information because of a concern that reports relating to millions of dollars in additional payments to Cohen appeared to have been removed from the SARs database, possibly as part of a cover-up. The Treasury Department, however, responded by explaining that, “[u]nder longstanding procedures, [the department] will limit access to certain SARs when requested by law enforcement authorities in connection with an ongoing investigation.” It therefore appears likely that, far from reflecting a cover-up, access to the “missing” reports was restricted at the request of prosecutors who are investigating Cohen and possibly others.

If there is a criminal investigation of the leak, Avenatti could be among the first people investigators will look to for information. Therefore, Avenatti may soon find himself to be a witness against his own source.

Avenatti says that he will refuse to name his source. According to Avenatti, journalists don’t have to disclose their sources, and “attorneys don’t have to disclose their sources either” because they are “covered by the work-product doctrine.” Avenatti’s argument, however, has no apparent basis in law.

The Supreme Court has declined to recognize that journalists have a constitutional right to maintain the secrecy of confidential sources, and Congress has not enacted a shield law to provide such protection. Accordingly, journalists can be compelled to name their sources. Furthermore, in past criminal investigations, prosecutors have subpoenaed journalists when they deemed it necessary to identify sources.

In any event, Avenatti does not claim to be a journalist and instead grounds his purported right to shield his source on the attorney work-product doctrine. That doctrine, however, offers no apparent protection for Avenatti here.

The work-product doctrine protects against disclosure of material prepared by or at the direction of an attorney in anticipation of litigation. Some courts have allowed attorneys to keep the identities of witnesses confidential where disclosing them would reveal a lawyer’s trial strategy, but identifying the source of a purloined document would not expose any such strategy.

Even if Avenatti somehow established that the work-product doctrine applied here, the privilege is qualified, and where an adversary demonstrates a sufficient need to review work-product material in order to obtain probative facts—here, facts that may relate to criminal activity—a court may compel disclosure.

Some may be surprised, even outraged, that Avenatti could be judicially coerced to reveal the source of his report.

That said, Avenatti is far from a whistleblower in any conventional sense of the word. His report did not appear to aid in bringing a potential wrongdoer to justice. Federal prosecutors have long been investigating Cohen. Indeed, it is possible that the leak of the SARs data might have interfered with their inquiry, even as it provided valuable information to the public.

It’s also important to note that while Avenatti has declared that his goal is to seek the “truth,” he is an attorney advocating for the interests of his client, not a journalist.

In a court filing, Avenatti cited Supreme Court cases providing that journalists generally cannot be penalized for publishing information that is illegally obtained by others. But as a leading legal-ethics expert has explained, attorneys are not allowed to use or disclose documents they know were illegally obtained in representing their clients, even if the attorneys played no role in purloining the documents. Indeed, Avenatti’s request for admission to intervene in the Cohen proceedings in the Southern District of New York could well be denied on ethical grounds.

Yet in these extraordinary times, Avenatti does seem like something of a hero, even if he is acting outside the boundaries that normally govern the conduct of attorneys. Furthermore, it’s possible that, by shedding light on important information, he is furthering the public good.

Even though Avenatti sometimes conducts himself more like a troll than a lawyer, a troll may be just what our republic needs in this moment.