Cosmic Cube is the name of a fictional device that exists in the Marvel Universe.
The Cube was then recovered by S.H.I.E.L.D. and brought to Project: Pegasus. Wundarr employed it to examine its power. The Cube was stolen by Victorius, and used to create Jude the Entropic Man. The Cube was then returned to Project: Pegasus by Captain America and the Thing. The Cube then transformed Wundarr into the Aquarian.
The power of the Cosmic Cube was then wielded by Doctor Strange, the Scarlet Witch, Spider-Man, and the Thing to vanquish the original Serpent Crown from all realities. The Cosmic Cube was then used by AIM leader Bernard Worrel to battle Captain America and the Aquarian. However, during this encounter the Cube hatched, and achieved sentience. The being that resulted became a student of the Shaper of Worlds. This being eventually evolved into the being named Kubik.
A new superhero in the Marvel Universe named Freedom Ring got his superpowers from a ring crafted from a fragment of a Cosmic Cube, thus giving him reality-warping powers. The Cosmic Cube possess such power that numerous supervillains have sought it out including Thanos, Korvac, the Red Skull, and Doctor Doom. Doom even once used a cosmic cube, along with several other cosmic artifacts, to usurp the power of Galactus.
The Beyonder was a tormented cosmic being which, in its desire to develop and learn, caused the universe-shaking events known as the Secret Wars. After many attempts to fill the void it sensed in itself, the being was confronted by Owen Reece, the Molecule Man, with whom he had had many other clashes. Aided by Kubik and the Shaper of worlds, as well as the Fantastic Four, they put the pieces together: years ago, the Beyonders had sought to once again shunt an amount of energy to the universe of Marvel-earth in response to someone opening a rift to their universe. But the transfer went awry, because unlike before, the rift was created unintentional - namely in the accident which Owen Reece had always assumed had given him his Molecule Man powers. He received part of the immense power of the Cosmic Cube, but lacking the knowledge and wisdom to use it properly, he initially acted as a powerful but petty supervillain, eventually sinking back into a mundane, suburban lifestyle. Meanwhile, the rest of the power, considerably more, was shunted into another dimension altogether - it is even possible the power created its own dimension. Here, it was everything, so there was nothing to disturb its peace... except a tear in its dimension through which it could spy another universe. This turned out to be the rift through which it had entered its dimension in the first place, but since it had no memory up to that point, the energy which should have become a Cosmic Cube came to assume the tear was opened by the accident Owen Reece suffered, without realizing that same accident was also its own origin. In any case, from this moment on, it knew no more peace, and ventured into what came to be known as the Secret Wars, at the end of which it was returned to its own empty dimension. There it formed an entire universe in its own right, strongly resembling the universe it had experienced, but with him, the Beyonder, as its God. However, eventually he was confronted by the cosmic beings Kubik and the Shaper, and eventually was convinced to merge with Owen Reece to finally form a whole being - a complete cosmic cube. Owen Reece was eventually returned by the Beyonders, and the newly formed Cosmic Cube developed its own sentience as Kosmos, a being who went on to be tutored by Kubik.
During the Infinity Crusade storyline, Mephisto agrees to reveal all he knows about Cosmic Cubes to Adam Warlock and Thanos. According to Mephisto, the Cosmic Cubes are theoretically as powerful as the Infinity Gems, but unlike the gems, the undeveloped cubes are host to a semi-sentient will (that will eventually evolve to a physical being like Kubik or the Shaper of Worlds) that can make selections as to how its wielder may use the cube's wish-granting powers. The cubes simply "refuse" to, for instance, commit universal genocide as the Goddess tried to do or to affect souls, both of which the semi-sentient cube beings considers to be taboo. The only thing that can overcome the semi-sentient cube being's self-imposed restrictions is, according to Mephisto, a universally linked will generated by millions of sentient beings at the same time, which was the Goddess's goal with the cubes - to unlock their full universal potential in order to "purify" the universe from evil. The Goddess merged 30 Cosmic Cubes, including the five units the Magus once possessed, into a "Cosmic egg" which she had situated herself in so she could harness its power undisturbed from outside forces that may try to usurp it. It is not clear whether Mephisto meant that an uninhibited cube would be a match for the composite Infinity Gauntlet or for individual Infinity Gems. For sharing this knowledge, Mephisto demanded that Thanos would give him a Cosmic Cube as payment for the information, which Thanos actually did; however, Mephisto never specified that the cube should be a functioning unit, so Thanos took advantage of this oversight from Mephisto's side to trick him without actually breaking the deal, giving him a dysfunctional cube, something that greatly angered Mephisto.