Facebook can't get out of its own way.

Facebook Inc. (FB - Get Report) shares fell Wednesday after the social networking firm said several Chinese companies, including one probed by U.S. security officials, were given preferred access to user data.

Facebook confirmed late Tuesday that Huawei, the world's third largest handset maker that was banned from bidding on U.S. government contracts four years ago owing to security concerns, was one of the sixty companies revealed to have been granted access to Facebook's  API, or application program interface, under various commercial agreements. The access, first revealed in a New York Times report Sunday, was also granted to three other China-based groups, raising the ire of U.S. lawmakers.   

"The news that provided privileged access to Facebook's API to Chinese device makers like Huawei and TCL raises legitimate concerns, and I look forward to learning more about how Facebook ensured that information about their users was not sent to Chinese servers," Democratic Senator Mark Warner said in a statement to the House Intelligence Committee.

Action Alerts PLUS holding Facebook shares were marked 0.73% lower at the opening bell in New York Wednesday and changing hands at $191.54 each, a move that trimmed its year-to-date gain to around 8.5%.

"Facebook along with many other U.S. tech companies have worked with them and other Chinese manufacturers to integrate their services onto these phones," Facebook's Francisco Varela, vice president of mobile partnerships, said in a statement. "Facebook's integrations with Huawei, Lenovo, OPPO and TCL were controlled from the get-go and we approved the Facebook experiences these companies built."

This is a disgrace. I am closing my Facebook page. Followers are welcome to contact me on Twitter. https://t.co/DV2MOaTf5K

— Howard Dean (@GovHowardDean) June 6, 2018

FBI Director Chris Wray told lawmakers on the Senate Intelligence Committee earlier this year that the U.S. government was "deeply concerned about the risks of allowing any company or entity that is beholden to foreign governments that don't share our values to gain positions of power inside our telecommunications networks."

Huawei is "essentially under the control of the Chinese government," Wary said. "It is hard for me to believe that a company such as Huawei would not do the bidding of the Chinese government and would not build traps, backdoors into its technology on behalf of the Chinese government."

The New York Times reported Sunday that Facebook allowed the preferred access to certain device makers, such as Apple Inc. (APPL) , Amazon Inc. (AMZN - Get Report) Microsoft Inc. (MSFT - Get Report) and Samsung Electronics Co. (SSNLF) , over a number of years as the firm sought to expand its influence in the social media marketplace. The paper said some of the access, however, may have violated portions of a 2011 consent decree with the Federal Trade Commission given that Facebook shared the user data -- and in some cases the data of users' friends -- without first obtaining specific consent.

The Times also reported that Facebook had "exempted the makers of cellphones, tablets and other hardware" from the kind of restrictions it placed on developers attempting to access user data that were put in place following its discovery, in 2015, the Cambridge Analytica had obtained information on 87 million customers that ultimately led to the company's biggest-ever scandal and a series of "mea-culpa" appearances before lawmakers in Europe and the United States by CEO Mark Zuckerberg.

Amazon and Microsoft are holdings in Jim Cramer's Action Alerts PLUS member club. Want to be alerted before Jim Cramer buys or sells AMZN or MSFT? Learn more now.