U.S. border agents are allowed to search a traveler’s laptop, cellphone or other electronic device and keep copies of any data on them based on no more than a hunch, according to an internal study from the Homeland Security Department. However, limiting such searches could prevent the U.S. from detecting child pornographers or terrorist, exposing the government to lawsuits.

According to CBS Washington, the 23-page report from December 2011 says that the border search does not violate the First or Fourth amendments, which prohibit restrictions on speech or unreasonable searches and seizures.

The U.S. government maintains that anything a person carries across the border, including a backpack, laptop or anything hidden inside a person’s body, is fair game to be searched as a means of keeping drugs, child pornography and other dangerous goods out of the country, as well as to enforce import laws. However, as more Americans enter the U.S. with sophisticated computers, thumb drives, smartphones, cameras and other electronics that carry vast amounts of information about who they are and how they conduct business, the article says, privacy rights advocates are pressing for more checks on authorities, especially if digital files are copied and shared with other agencies, such as the FBI.

According to the study, 685 of the roughly 50 million travelers entering the U.S. in 2009 and 2010 were subject to electronic device searches. Of those, 41 devices were held by the government.

The ACLU, the National Association of Criminal Defense Lawyers and other groups have sued to stop the practice on the basis of First and Fourth amendment rights. The practice of allowing agents to act on hunches also encourages racial profiling, they say.