In 2017, a couple are seen to be having sex at a secluded residence. The woman later goes to the kitchen to get a glass of water. When she hears a loud thud, she goes to find her fling, Travis Green. After a short search, she finds him in the bathroom tub in a pool of blood. As she screams, a hand reaches and grabs her.
In the present, Ellie Warren is a successful attorney living with her husband Marcus who is recovering after a horrible car accident. They have just moved into a new house on the coast from the city of San Francisco now that their daughter Brittany has left for college. At work, Ellie’s boss Janice wants her to stay on after she’s done with Ellie’s last case despite Ellie’s decision to leave to start her own practice. Janice introduces the firm’s new tech consultant, David Hammond who Ellie is surprised to see since she knows him from college.
David asks Ellie to get drinks to catch up but Ellie already has plans with her friend Courtney and invites David to meet them. Courtney gets stuck at work, and so Ellie has drinks with David alone. She admits she sometimes feels like she’s sleeping with a stranger with Marcus. They go to a club, where they dance and later begin kissing in the bathroom. They almost have sex, but Ellie says she can’t and rushes off. She goes back to living with Marcus and tries to make their relationship really strong. David constantly calls her. She also gets an office space for her new firm.
David goes to see his therapist. It is revealed that he began seeking therapy due to court ordered anger management, after an incident with a woman named Deborah. Later, David approaches Ellie, and asks why she isn’t returning his calls. He asks Ellie to get coffee, but she says she can’t as she’s married, and leaves. Ellie keeps getting calls and texts from David but blocks his number. She and Marcus have sex, and David watches from outside their window. Ellie and Marcus have Courtney over for dinner, and Ellie is stunned when she brings David as her date. David pretends to not know Ellie, who plays along as well. When alone, Ellie confronts David and tells him that she never wants to see him around her or her family ever again. She tells him to make an excuse to leave, which he does.
Next day, Ellie finds a package on her deck from David. She calls Courtney but isn’t able to get hold of her, and meets David to confront him. She wants to know what it will take to get him away from her and her friends and family. He snaps at her and calls her Deborah. She gives him the record he left for her in the package, and he snaps it in half. Courtney stops at Ellie’s firm to meet Ellie and says that David told her about how Ellie tried to seduce him and he turned her down. Not believing Ellie’s explanation, Courtney storms out.
Ellie goes to see an old friend from college, who tells her that David was totally obsessed with her in college. She also tells her that David’s ex-wife Deborah looked just like Ellie and that Deborah and her new boyfriend were murdered a few months after the divorce. (At this point it is revealed that Deborah is the woman from the beginning of the movie.) Ellie is terrified. At night, David breaks into Ellie’s house and goes through her things while she sleeps.
Ellie, later receives a video message from David containing surveillance footage of them dancing at the club that he hacked. She also doesn’t know that he has also hacked into her home security as well. She sends Courtney an e-mail with information about Deborah’s murder and how David likely committed it, but David deletes it. He then has sex with Courtney.
Ellie begins following David and is horrified to see him going golfing with Marcus. She is able to convince the concierge at David’s building to let her into his apartment, where she finds pictures of Deborah and of herself taken from afar on his computer. David comes home while she’s still in the apartment and escapes. Ellie calls Courtney and tells her about the pictures and that David is dangerous. Just then, David gets to Courtney’s place. Courtney looks on David’s phone and finds photos of Ellie but David catches her and attacks her.
Ellie rushes to Courtney’s place and finds her unconscious and bleeding from the head. Courtney is taken to the hospital, and the police tell Ellie they are looking for David. At home, Ellie tells Marcus the whole story. He is angry and upset. Meanwhile, David finds a homeless man and sets him on fire with a suicide note, faking his death. The police reveal that they found all the evidence in his home, including a confession for his ex-wife’s murder.
One night, Ellie gets a message from her assistant (presumably from David) to sign some documents. Ellie stops by her office and finds her assistant murdered on the floor. Ellie rushes home and calls the police on the way. She finds Brittany’s boyfriend Scott dead, but can’t find Marcus or Brittany.
David appears and tells Ellie that they can start a brand new life together. Ellie attacks David with a knife and then breaks a vase over his head. She finds Marcus and Brittany tied up. She frees them as the police arrive, but when they rush to the police car they find the cop dead. David attacks them, but they are able to lock Brittany in her car and tell her to drive away. Marcus fights David but he knocks him over a balcony. Ellie stabs David in the chest and finds Marcus and helps him up. David returns to the police car and gets the dead cop’s gun as Marcus and Ellie run to the beach. David confronts them with the gun, and a fight ensues at the cliffside. David falls over the edge and falls to his death.
A few months later, Marcus and Ellie send Brittany back to school, and their house is for sale.