A cube is currently a useless item, and often considered as junk.
A cube has no use, being added purely for the purpose of clutter, creating more realism for the player when looting. In the future, they might be usable to entertain the player.
Usually found in houses, children play areas and rooms, in book shelves and drawers of desks. They can also be found in the glove box of vehicles.
The cube seen in game is loosely based on the real life Rubik's Cube.
From newitems.txt (Project Zomboid directory/media/scripts/)
Weight = 0.2,
Type = Normal,
DisplayName = Cube,
Icon = Cube,