Even beyond the danger that Iran could use its $1.7 billion in air-freighted cash to fund terrorists, North Korea’s fifth nuclear test reminds us that Iran could also use its U.S.-begotten trove of hard currency to buy nuclear weapons technology — or even the warheads themselves — from cash-hungry North Korea.

Congress might want to keep that risk in mind, as lawmakers debate how to address what appear to be two separate issues, cash for Iran and nuclear tests by North Korea. In an interconnected world, especially one in which America’s retreat has encouraged a rising network of anti-U.S. alliances, let’s take a moment to survey these two big dots.

One is President Obama’s $1.7 billion financial settlement with Iran, shipped to Tehran early this year in three planeloads of foreign banknotes, with timing that raises questions of whether it was ransom for American prisoners, and secrecy that raises further questions about why Iran apparently demanded the entire sum in cash.

The other dot is North Korea’s latest nuclear test, its fifth since 2006, and the fourth on Obama’s watch, following tests in 2009, 2013 and this January. This latest test, Sept. 9, was North Korea’s biggest detonation to date, and one which North Korea attributed to a miniaturized warhead that can be placed on a missile.

This becomes yet more ominous in view of North Korea’s brazen activities to produce both plutonium and highly enriched uranium for bomb fuel. Last year The Wall Street Journal reported that some of China’s top nuclear experts had told their American counterparts that North Korea could double its arsenal from an estimated 20 warheads in 2015 to as many as 40 by 2016.

While there is no public information that connects Iran’s airborne cash bonanza with North Korea’s burgeoning nuclear projects, in the absence of far greater transparency and detailed accounting from the U.S. administration on both fronts, it would be folly to rule it out.

Iran and North Korea have a long, intimate history of arms deals, including missile development. This partnership enhances the likelihood that a North Korean miniaturized warhead might be readily compatible with an Iranian missile.

The longtime relationship has been one in which oil-rich Iran provides the lucre, while cash-famished North Korea serves as an illicit weapons laboratory and backshop for Tehran and its clients, including terrorist outfits such as Hezbollah.

Would North Korea scruple to proliferate its nuclear arsenal abroad? As Director of Intelligence James R. Clapper has testified to Congress, Pyongyang has already demonstrated “its willingness to proliferate dangerous technologies.” The prime example is North Korea’s help to Iran’s client state, Syria, in building a secret nuclear reactor at Al Kibar, on the Euphrates River, with no visible purpose except to produce plutonium for nuclear bombs. That reactor was destroyed by an Israeli air strike in 2007, but North Korea suffered no consequences serious enough to stop its arms traffic with the Middle East, or its nuclear program.

These days, for both Iran and North Korea, Obama’s policies have greatly enhanced both the incentives and opportunities for illicit nuclear cooperation. Between Obama’s preference for American retreat and his fading red lines, his final stretch in office — his fourth quarter, filled with "interesting stuff” — has become open season for opportunists.

Provided North Korea’s tyrant Kim Jong Un can scrape together the resources, why shouldn’t he sprint ahead with his nuclear missile program? There’s simply no heft to Obama’s ritual scolding that “The United States does not, and never will, accept North Korea as a nuclear state.”

Iran’s regime, without giving up its terrorist ways or its nuclear ambitions, is now getting a chance to refill its coffers — thanks to the Iran nuclear deal, bulldozed past Congress by Obama and implemented under United Nations auspices on Jan. 16. Under this deal, Iran enjoys substantial relief from U.N. sanctions, as well as a green light from the U.S. and the rest of the “international community” to carry on with what Obama administration officials have dubbed its “exclusively peaceful” nuclear program.

That has not stopped Iran, in violation of remaining UN sanctions, from continuing its tests of ballistic missiles, for which the only practical use is the delivery of nuclear warheads. The Obama administration appears unwilling to confront Tehran even for flagrant signs of bad faith, lest Iran walk away the entire deal. Instead, the White House continues to adorn its web site with the claim — controversial in its own right — that Obama’s “historic” deal will “Prevent Iran from Acquiring a Nuclear Weapon” by blocking all Iran’s pathways to fissile material.

But does the Iran deal block all Iran’s pathways to the nuclear bomb factory that is Kim Jong Un’s North Korea?.

In theory such pathways are blocked by a stack of U.N. Security Council sanctions, amplified by U.S. and other national sanctions programs, targeting North Korea’s missile and nuclear ventures. The latest UN sanctions resolution on North Korea, approved in March, was introduced by U.S. Ambassador Samantha Power as the “toughest” in “more than two decades.”

These sanctions still leak. None of them have stopped North Korea’s nuclear tests. Nor have they stopped North Korea’s production of bomb fuel. Nor have they prevented what Obama described Friday as “an unprecedented campaign of ballistic missile launches,” including tests of both submarine-launched and intercontinental missiles.

What all the tough and tougher sanctions may well have achieved, however, is to leave North Korea even hungrier than usual for hard currency, and seeking with even more than its usual verve whatever illicit channels and connections might help compensate for the shortfalls.

Which brings us back to one of the world’s likeliest customers for Kim’s nuclear wares: Iran’s regime, North Korea’s longtime business partner, on which Obama early this year lavished $1.7 billion in cash for the settlement of a dispute pending for more than 30 years before the Iran-U.S. Claims Tribunal in the Hague.

Would Iran dare do anything as over-the-top outrageous as buying warheads from North Korea? It’s quite possible there has never been a safer or more enticing moment for it. Obama’s passion to preserve the Iran nuclear deal, apparently at all costs, means that should his administration come across any evidence of nuclear traffic between Iran and North Korea, the incentive would be to bury it. Confronting either party, especially if it led to public disclosure, could wreck Obama’s legacy Iran nuclear deal while he is still in office — before it becomes the albatross of the next president.

Obama and his team have yet to provide a credible explanation of why Iran wanted the entire $1.7 billion paid in cash, or why, precisely, the administration kept the cash aspect and timing of the deliveries secret until details began to emerge more than six months later in the press.

But this we know: money is fungible, especially cash, which is hard to trace. It’s farcical for senior Obama administration officials to suggest, as they now have, that these air-shipped foreign banknotes were used mainly for domestic infrastructure projects. It would be quite odd for Iran to pay its local road-repair workers not in domestic rials, but in euros and Swiss banknotes. As for any badly needed benign imports, Iran’s government could more easily pay for those by keeping the hard currency abroad to cover the bills.

This February, President Hassan Rouhani’s vice president for planning and budget, Mohammad Bagher Nobakht Haghighi, told the Financial Times that Iran preferred to keep most of its newly unfrozen $100 billion abroad — specifically to help maintain a stable rial while paying Iran’s foreign bills. That story ran on Feb. 8, just three days after the last of the Obama administration’s $1.7 billion worth of cash shipments was airlifted to Iran.

It all makes a lot more sense if Iran’s aim was to parcel out the cash on its own turf, to be shipped back out for purposes Tehran might want to keep below the global radar. The question is not only whether this $1.7 billion, including some $1.3 billion taken from the pockets of American taxpayers, ended up in the hands of terrorists, but did any of it go to nuclear-testing North Korea?

Ms. Rosett is a Foreign Policy Fellow with the Independent Women’s Forum, and blogs at PJMedia.com.