Why the U.S. visa process missed Tashfeen Malik's zealotry on social media

American law enforcement officials said they recently discovered those old — and previously unreported — postings as they pieced together the lives of Ms. Malik and her husband, Syed Rizwan Farook, trying to understand how they pulled off the deadliest terrorist attack on American soil since Sept. 11, 2001.

Had the authorities found the posts years ago, they might have kept her out of the country. But immigration officials do not routinely review social media as part of their background checks, and there is a debate inside the Department of Homeland Security over whether it is even appropriate to do so.

The discovery of the old social media posts has exposed a significant — and perhaps inevitable — shortcoming in how foreigners are screened when they enter the United States, particularly as people everywhere disclose more about themselves online. Tens of millions of people are cleared each year to come to this country to work, visit or live. It is impossible to conduct an exhaustive investigation and scour the social media accounts of each of them, law enforcement officials say.

In the aftermath of terrorist attacks in San Bernardino and Paris, this screening process has been singled out as a major vulnerability in the nation’s defense against terrorism. Lawmakers from both parties have endorsed making it harder for people to enter the United States if they have recently been in Iraq or Syria. Donald J. Trump, the Republican presidential candidate, has said there should be a temporary ban on Muslims’ entering the country.