It's believed to be a folk tale that has been passed down through generations in oral tradition in the Malay Archipelago. The story has been retold and adapted many times, but no definitive author has been credited.