Two programmers have discovered that the latest operating system powering the iPhone and iPad keeps a log of everywhere you go, recording both the location and time you were there.

The feature has been around since June 2010, meaning some iPhones have nearly a year of location history recorded in a single file -- every step, trip to the park, family vacation and more. And that, said Alasdair Allan and Pete Warden, who uncovered the file, poses serious problems.

"It became clear that there was a scary amount of detail on our movements [in the iPhone]," they noted in a post on their website.

"By passively logging your location without your permission, Apple has made it possible for anyone from a jealous spouse to a private investigator to get a detailed picture of your movements."

Apple did not respond to calls or e-mails for comment from FoxNews.com.

More On This...

The two British programmers accidentally discovered the iPhone feature -- some would call it a bug -- when they were making software based on user locations. And digital privacy consultant Frank M. Ahearn says he has seen the problems caused by such lack of privacy first-hand.

"It's a scary world," Ahearn told FoxNews.com. "I've worked with clients where, for instance, a woman started realizing that her husband knew lots things he just shouldn't have known … eventually we figured out that he could tell where she was based on her phone's GPS."

Not all cell phones track the same information, though the exact details of what's being tracked are unclear. Microsoft told tech bloggers at Gizmodo that only the last location is stored on Windows Phone 7-powered devices, to support the Find My Phone feature. Google refused to tell whether Android-powered smartphones store location information in a similar fashion -- though Android phones do allow a user to opt out of location collection.

Who would use such information? Employers are starting to trace employees using company-issued cell phones, Ahearn said. It was not clear why Apple was recording the information or how the company would use it, if at all.

But the iPhone feature could be good news for police. According to the ACLU, Michigan police are currently using a device called the Cellebrite UFED during traffic pull-overs. It can grab all the data out of a phone within minutes.

The company that sells the Cellebrite UFED advertises it to law enforcement: "Get the evidence you need -- immediately."

The company's website goes on to note: "Easy to use in both the field and in lab environments, UFED extracts vital data such as phonebook, pictures, videos, text messages, call logs … it then gathers the data into reports for research and evidence."

But the ACLU argues that the use of the device by police officers during traffic stops would be illegal, and is attempting to obtain Internal records on exactly how the department uses the devices.

"[The devices] allow them to extract information from cell phones without a warrant," Kary Moss, Executive Director of the Michigan ACLU, said.

"The U.S. Constitution acknowledges that people who are not suspected of a certain crime have certain rights -- police have to obtain a search warrant."

A spokesman for the Michigan State Police said that they were drafting a statement on their use of the devices, but it was not ready by Wednesday evening.

But to the matter at hand: What can you do if you want to ensure your data is safe?

Ahearn says the simplest method is just not to use a fancy phone. As of now there is no known way to stop an iPhone with OS 4 from logging locations.