In the latest twist in the sex scandal roiling the highest levels of the U.S. security establishment, court records show that former CIA director David Petraeus and Gen. John Allen intervened in a custody dispute to help Jill Kelley's twin sister, whom a judge described as dishonest and lacking integrity.

Kelley is the self-appointed Tampa, Fla., “military liaison” who received harassing emails from Paula Broadwell, Petraeus' biographer and then-mistress, according to U.S officials. She also is thought to have exchanged flirtatious communications with Allen, the top U.S. commander in Afghanistan. Pentagon investigators are now examining Allen's relationship with Kelley.

Allen Tuesday denied any affair with her.

The new court files, reported by the Associated Press, provide a more complete picture of the 37-year-old twins' connections to Petraeus and Allen. It also raises questions why two of the nation’s most powerful and decorated generals would vouch for Kelley's sister, Natalie Khawam, who had many legal troubles in recent years.

Petraeus quit suddenly on Friday as CIA director after disclosures that Broadwell sent the emails to Kelley, who in turn went to the FBI, setting off a series of stunning revelations that have engulfed Washington just days after President Barack Obama was re-elected.

Both Allen and Petraeus wrote letters in September supporting Khawam in her custody fight for her son, D.C. Superior Court records reported by the AP show. Allen met Khawam when he was deputy commander of U.S. Central Command in Tampa, where they attended social functions. Petraeus said he met Khawam three years ago through Kelley.

Both men said she was a loving mother and asked the judge in the case to drop onerous visitation restrictions. "In light of Natalie's maturity, integrity and steadfast commitment to raising her child, I humbly request your reconsideration of the existing, mandated custody settlement," Allen said.

But Superior Court Judge Neal Kravitz a year earlier criticized Khawam for her behavior and said her "misrepresentations about virtually everything" would continue.

"Ms. Khawam appears to lack any appreciation or respect for the importance of honesty and integrity in her interactions with her family, employers and others with whom she comes in contact," he wrote in November 2011.

Not only did the judge award her ex-husband custody of their 3-year-old son, John, but he also told Khawam to pay his legal bills amounting to $350,000. Khawam filed for bankruptcy in April after racking up more than $3 million in debt, according to federal court records.

The status of her most recent custody appeal was not immediately known.

Khawam did not respond to requests for comment Tuesday.

Meanwhile, the Huffington Post reported Tuesday that Kelley and her husband Scott ran a questionable cancer “charity.”

Based out of the couple's Tampa mansion, the Doctor Kelley Cancer Foundation claimed on its tax forms that it "shall be operated exclusively to conduct cancer research and to grant wishes to terminally ill adult cancer patients."

But financial records reviewed by the Huffington Post reveal that the group spent all of its money not on research, but on parties, entertainment, travel and attorneys fees.

By the end of 2007, the charity had gone bankrupt, having conveniently spent exactly the same amount of money, $157,284, as it started with -- not a dollar more, according to its 990 financial form. Of that, $43,317 was billed as "Meals and Entertainment," $38,610 was assigned to "Travel," another $25,013 was spent on legal fees, and $8,822 went to "Automotive Expenses."

The Kelleys also listed smaller expenses that appear excessive for a charity operating from a private home, including $12,807 for office expenses and supplies, and $7,854 on utilities and telephones.

The only other officer of the charity was -- Natalie Khawam.

The twins grew up in the Philadelphia area, daughters of a Lebanese immigrant couple who owned a local restaurant, ABC News reports. Jill and Natalie would appear together on a 2003 episode of a Food Channel program called "Food Fight," in which they dressed in designer clothes while cooking alligator in a cook-off against two brothers.

After Kelley and her husband Scott, a cancer surgeon, moved to Tampa, Khawam came to live with them and their three children in their $1.5 million home on Bayshore Boulevard.

On Tuesday, people familiar with the case told the Wall Street Journal that at one point in the summer, after the Petraeus investigation began pointing to larger national security issues, Kelley tried to get the FBI to drop the matter because she was worried about the personal information being provided to investigators.

Kelley developed misgivings after friends in her Tampa social circle urged her to drop the matter, saying the probe would only cause bigger problems, the Journal’s sources said.

Broadwell was “hiding out at her brother's home in Washington, D.C,” Tuesday, the Daily Mail reported.

Meanwhile, Sen. Dianne Feinstein, D-Calif., chairwoman of the Senate Intelligence Committee, said Tuesday she still wants Petraeus to testify on the Sept. 11. Benghazi, Libya, attack as previously scheduled.

"I believe he will. I think he's a responsible person and I believe he will come. We are going to try to set that up today," she said in an interview on CNN's "The Situation Room with Wolf Blitzer."

Feinstein said the fallen CIA director's testimony is relevant because news of his affair broke after his recent trip to Libya, including Benghazi. He discussed the attack with the CIA station chief there.

Feinstein told CNN her committee could call Petraeus as early as Friday morning. She said she and Vice Chairman Saxby Chambliss, R-Ga., are meeting with acting CIA chief Michael Morell, and other intelligence officials as part of an "inquiry" into the consulate that killed four Americans.