During a party at hedonistic millionaire Roland Voight’s mansion, sex worker Joey comes across a mechanical puzzle box, which Voight insists he solve. Joey solves the configuration and is stabbed by a blade hidden inside the box. A portal opens, from which chains fly out and rip Joey apart, as Voight demands an audience with Leviathan.
Six years later, recovering addict Riley is living with her brother Matt, his boyfriend Colin, and their roommate Nora. Riley’s boyfriend, Trevor, convinces her to help break into an abandoned storage warehouse, where they discover the puzzle box. Returning home late, Riley gets into an argument with Matt and leaves. At an empty park, she solves the box but avoids being cut by the blade. The Cenobites, a group of deformed humanoids, appear and demand she choose another as sacrifice. Matt finds Riley blacked out and, as he tries to wake her up, inadvertently cuts himself on the box. He goes to a nearby restroom to clean his wound. Riley hears him scream and discovers that he has vanished.
Believing the box caused Matt’s disappearance, Riley and Trevor track down Serena Menaker, Voight’s former lawyer, who had hidden it in the warehouse. Menaker tries to take the box from Riley but is inadvertently cut by the blade and is later taken by the Cenobites. Riley visits Voight’s abandoned mansion, finding his journals and learning that the box has multiple configurations, each of which requires a victim to be “marked” by the box’s blade for the Cenobites to take. On completion, the box allows its holder to receive a “gift” from Leviathan, the entity that rules over Hell. Riley sees an apparition of Matt and is horrified to discover he has been flayed.
Trevor, Colin, and Nora arrive to take Riley home. While Riley explains her findings to Colin, the still-living but mutilated Voight, who is hiding inside the walls, stabs Nora with the box. The group attempts to escape the mansion in a van, but Nora is taken by the Cenobites. Their leader, the Priest, taunts Nora, then flays her. The group crashes the van and tries to walk back to the mansion. Riley encounters the Priest, who commands her to sacrifice two souls with the last two configurations, or the Cenobites will take her. After Trevor is injured by one of the Cenobites, the Chatterer, Riley solves the next configuration and stabs it. The Cenobite gets torn to pieces as the next sacrifice.
The group makes it back to the mansion, realizing that there are steel doors designed to lock the Cenobites out. Riley and Colin leave Trevor to rest, and it is revealed that Trevor has been working for Voight to find people to sacrifice to the puzzle box. Riley and Colin trap a Cenobite, the Asphyx, to become the last sacrifice, but Voight appears and stabs Colin with the box. Voight reveals that he sought new pleasurable sensations after completing all of his sacrifices, but his “reward” was a contraption attached to him that twists his nerve endings, leaving him in constant pain. He completes the final configuration and traps the Cenobites, demanding they ask Leviathan to free him from his “gift”. Leviathan appears in the sky above the mansion. Riley retrieves the box and unlocks the steel doors, letting the Cenobites in. Riley saves Colin from torture by stabbing Trevor, choosing him as a new final sacrifice. Trevor is mutilated and dragged to Hell. Meanwhile, Voight bargains with the Priest to grant him a different gift, and she offers him “power”. Voight is released from his contraption and momentarily healed, before Leviathan impales him with a large chain and takes him away.
Tempted by the Priest into resurrecting Matt, Riley refuses to wish for a gift because she knows the Cenobites’ rewards are always twisted. The Priest tells her that she has chosen to live with the guilt of her actions. The box reverts to its original configuration and the Cenobites disappear. As Riley and Colin leave the mansion, he asks her if she made the right choice; Riley remains silent. Meanwhile, inside Leviathan, Voight undergoes a brutal transformation into a new Cenobite.