Aran Khanna's app - called Marauder's Map in tribute to the Harry Potter books - showed that users of Facebook Messenger could pinpoint the exact locations of people they were talking to.
He told Boston.com he created the app to show the consequences of unintentionally sharing data and thought he was doing a public service.
"I didn't write the program to be malicious," he said.
Khanna launched the app from his dorm room in May and said 85,000 people downloaded it.
Days later, Facebook asked Khanna to disable it. A week after that, Facebook released a Messenger app update addressing the flaw.
Facebook spokesman Matt Steinfeld said the company had been working on a Messenger update months before it became aware of Khanna's app.
"This isn't the sort of thing that can happen in a week," Steinfeld said.
Two hours before he was supposed to leave to start his internship, Khanna received a call from a Facebook employee telling him that the company was rescinding the offer because he had violated the Facebook user agreement when he scraped the site for data.
Khanna wrote about the experience in a case study published Tuesday for the Harvard Journal of Technology Science. He spent the summer interning at a Silicon Valley startup and said the back-and-forth with Facebook ended up being a learning experience as well.
Facebook co-founder Mark Zuckerberg launched the social media site from a Harvard dorm room in 2004.
For the latest tech news and reviews, follow Gadgets 360 on X, Facebook, WhatsApp, Threads and Google News. For the latest videos on gadgets and tech, subscribe to our YouTube channel. If you want to know everything about top influencers, follow our in-house Who'sThat360 on Instagram and YouTube.