Researchers have raised privacy fears with the latest discovery: any iPhone or iPad with iOS 4 can track your whereabouts by recording your latitude and longitude coordinates along with a timestamp. Apple was contacted but has not responded to any inquires.

(PhysOrg.com) -- Security researchers have discovered that any iPhone or iPad that has been updated with iOS 4 records everywhere you have been to a secret file. The file is also copied to the owner’s computer whenever the two are synchronized.

According to the Guardian, all your locations are logged to a file called “consolidated.db” and contain latitude and longitude coordinates along with a timestamp. The file can contain tens of thousands of data points since iOS 4’s release in June 2010.

Pete Warden and Alasdair Allan, founder of Data Science Toolkit, discovered the file and presented their findings today to the Where 2.0 conference in San Francisco. Alasdair has also looked into Google’s Android phones for similar tracking code and could not find any.

It’s not sure why Apple is collecting this data but it’s clearly intentional because the data is being restored across backups and phone migrations. Apple’s Product team was contacted but no one has responded.

In the following video Pete Warden and Alasdair Allan discuss how the file was discovered and exam the data in the file.

There is also no evidence that indicates that this data is leaving your phone and being viewed by anyone. Pete Warden has built an application that will allow anyone with an or , using iOS 4, to view the data being stored (see more information below).

Map displays a visualization of iPhone data collection. Credit: O’Reilly radar.

More information: Guardian, iPhone tracker