Until a few weeks ago, the Clinton Foundation was a magnet for controversy, while the tiny Donald J. Trump Foundation remained in the shadows. Suddenly, a damaging expose in the Washington Post and the disclosure of an illegal campaign contribution paid by the Trump Foundation to Florida Attorney General Pam Bondi, who subsequently decided not to pursue an investigation of scandal-plagued Trump University, has unleashed a storm of criticism and rendered the once obscure charity a major drag on the Trump campaign.

But what legal problems does the Trump Foundation really pose for the Republican candidate?

On September 13, Eric Schneiderman, the New York State Attorney who is leading the lawsuit against Trump University, stated that his office is now investigating the Donald J. Trump Foundation. “We have been concerned that the Trump Foundation many have engaged in some impropriety,” Schneiderman told CNN’s Jake Tapper. “My interest in this is in my capacity as regulator of non-profits in New York State.”

Trump spokesman Steven Cheung assailed the new investigation as a witch hunt orchestrated by Clinton supporter Schneiderman to hobble her opponent. Cheung denounced Schneiderman as a “partisan hack who has turned a blind eye to the Clinton foundation for years.”

On the same day, all 15 Democrats on the House Judiciary Committee sent a letter to Attorney General Loretta Lynch requesting that the Justice Department launch a criminal investigation of Trump in connection with his foundation’s $25,000 donation to Pam Bondi. The letter specifically cited anti-bribery laws.

Trump and his foundation also face a third line of attack. Citizens for Responsibility and Ethics in Washington, the left-wing watchdog that initially exposed Trump’s illegal political contribution, has filed a complaint with the IRS citing evidence that would compel the agency to revoke its tax-free status.

The CREW assault goes far beyond its demands on the IRS. The day of the Schneiderman announcement and Democrats’ letter, CREW filed a complaint requesting that the Acting US Attorney in the Northern District of Florida start a criminal investigation into whether Bondi solicited a bribe from Trump, and whether the Foundation’s payment amounted to the bribe she allegedly requested. Both Trump and Bondi have repeatedly denied any wrong-doing.

Lost in this flurry of demands, accusations and counter-accusations are the actual regulations governing non-profits, and in some cases, the surprisingly mild penalties for violating them.

Schneiderman has declined to specify the possible violations that his office is investigating. But it’s instructive to examine the charges that the Foundation’s opponents want the IRS and Justice Department may investigate.

The alleged wrongdoing divides into two main categories. The first is the allegation that Trump used the Foundation’s money for his own benefit, by channeling charitable contributions to buy things for himself. In 2007, at an auction benefiting a children’s charity at Mar-a-Lago, Trump bid $12,000 for a helmet and jersey signed by then-Denver Broncos quarterback Tim Tebow. Trump was photographed proudly brandishing the memorabilia, and allegedly kept the stuff as a souvenir.

In 2012, his wife Melania bid $20,000 for a portrait of the Donald, created on the spot by a “speed painter” at a breast cancer fundraiser, also at Mar-a-Lago. Trump kept the six-foot painting––it now reportedly hangs at one of his golf courses––and President Obama couldn’t resist skewering Trump with faux-praise for not demanding a 10-foot rendering.

How serious are these violations? It’s important to recognize that under IRS rules, the Trump Foundation, despite its name, is technically not a Foundation, but a public charity. The IRS made the distinction because public charities are funded by lots of donors, and therefore “self-policing.” If they do things that undermine public confidence, they either raise less money, or shut down. By contrast, foundations such as the Ford Foundation are self-funding and do not depend on public contributions, so they can keep operating even if they’re mired in controversy. As a result, the IRS rules on foundations are far tougher than for public charities, and the less stringent regulations apply to the Trump Foundation.

For a foundation, using the institution’s money for the benefit of, say, an officer is called “self-dealing,” and the penalty can be loss of tax-free status. But for a public charity, it’s called “inurement.” The IRS rules require the person receiving the benefit to repay the amount of that benefit to the charity, plus a 25% penalty to the IRS.

But these rules apply not to the total the officer or recipient paid for the goods he or she kept, but the excess benefit they received–in other words, the value of the goods they actually received. Say the 6-foot picture has a resale value of $1,000 (how much can a seven minute painting be worth?) Then the breast cancer charity effectively got a donation of $19,000, and Trump received an excess benefit of $1,000. So Trump would be required to pay the $1,000 back to the foundation, and write the IRS a check for $250. Similar math would apply to the Tebow memorabilia, which is certainly worth a fraction of the $12,000 the Trump Foundation paid, meaning Trump wasn’t “buying” much with the $12,000 contribution.

If the charity doesn’t fix the wrongdoing, the person getting the excess benefit is required to pay a 200% penalty. It’s not clear what penalty the IRS is likely to impose, but the excess benefit dollars are small.

Using a charity’s money for personal benefit, if the cases are infrequent, isn’t sufficient for the IRS to revoke tax-free status. That “ultimate penalty” is reserved for institutions so corrupt that they no longer effectively operate as charities by giving the money they collect to worthy causes. So far, at least, it appears that the Trump Foundation donates most of its money to prestigious charitable organizations, so chances are slim that the IRS would take action beyond the “excess benefit” fines. (Of course, if the accusations that the foundation claimed to the IRS that it gave money to charities that never received prove true, the IRS could take far more stringent measures.)

The second category of wrongdoing is the foundation’s $25,000 payment to the pro-Bondi super-PAC, And Justice for All, in September of 2013. IRS rules state explicitly that money from a charity cannot be used for political purposes. The Trump Organization, whose staff runs the foundation, acknowledged the mistake. The IRS imposes a 10% penalty on money that’s used for non-charitable purposes, a category that includes illegal political contributions. Trump personally paid the $2,500 penalty.

Once again, that 10% fine is an “intermediate penalty.” The $25,000 contribution does not rise to the level of the ultimate penalty in which the IRS revokes a charity’s tax free status—once again because it at least appears that this is a rare case in which the Foundation’s money did not go to a bona fide charity.

On the other hand, the charges that the Congressional Democrats and CREW want the Justice Department and Florida US Attorney to investigate are totally different, and far more serious. These are criminal accusations of bribery against Trump, and in the case of CREW’s complaint in Florida, of soliciting and accepting a bribe by Bondi. The letter to the Attorney General cites possible violation of two federal bribery statutes, including one “pertaining to bribery schemes that deprive constituents of the honest services of public officials.”

The accusations hinge on whether Bondi declined to investigate Trump because of the $25,000 contribution. Both Trump and Bondi vehemently deny there was any connection between the donation and her decision not to take action. In an email to Fortune, her spokesman stated that “There was never any recommendation by the staff to investigate or sue Trump University, and consequently, the matter never rose to the Attorney General’s level for any decision of any kind.”

In this election, both camps are bashing the other candidate’s foundation. So far, it’s been more about pundits and surrogates hurling accusations than facts that would justify drastic legal action. Even so, the perception that either Trump or Clinton are abusing their charities for political gain could prove an issue that will sway voters on November 8th.