A poor woodcutter, Alibaba, stumbles upon a cave where a band of thieves hide all their loot. Alibaba waits until the thieves leaves, then sneaks into the cave and steals a small bag of gold coins. After learning about this cave, Alibaba's greedy brother tries to do the same, but he gets caught and killed by the thieves. Alibaba discovers his brother’s body in the cave and takes him home for a burial. The thieves then realise that there are more people who know about the cave and decide to investigate. It is a quick-thinking servant named Morgiana who eventually dodges all their attempts to kill Alibaba and defeats the forty thieves.