It appears that the Cuban weapons Panamanian inspectors found on a North Korean freighter seized last July were not being sent to North Korea “for repairs” but were Cuban military surplus (stuff the Cubans could not afford to operate and maintain) being sold to North Korea. The illegal cargo of Cuban SA-2 anti-aircraft missile systems and MiG-21 components (including over a dozen jet engines) was buried under a cargo of sugar headed through the Panama Canal. The illegal and undeclared weapons shipment also included some lighter arms. But mostly it was stuff North Korea needed but had a difficult time obtaining (like anti-aircraft missile components and replacement engines for their elderly MiG-21 fleet).
In recent years, a North Korean freighter has been showing up in Cuba every three of four months. Often the North Korean ships traveled (in violation of international law) with its tracker turned off. The trips to Cuba were long believed to be some kind of smuggling operation, but since Cuba had little of military value for North Korea, no one looked too closely. At first it was thought that Cuba was trading sugar for repair services (on the missiles and the jet fighters and their engines, which wear out quickly). Now it turns out Cuba was selling their main export (sugar) as well as surplus weapons. Cuba is, like North Korea, one of the few communist states to survive the massive collapse of communist countries in the late 1980s and early 1990s. Cuba has been more energetic than North Korea in allowing economic freedom and is economically better off than North Korea but is still short of cash. North Korea and Cuba are in violation of the sanctions against North Korea, although neither is much concerned about international criticism. North Korea has been caught recently buying MiG-21s illegally (from Mongolia) and has been active on the arms black market for over two decades.