The story
A reference to the story of Ali Baba and the Forty Thieves, in which the thieves hide in large oil jars; perhaps based on the idea that the bag is large enough to fit a person. Compare senses of Ali Baba related to large containers.
Etymology from Wiktionary, CC BY-SA 4.0.