The law -- Section 230 of the Communication Decency Act -- shields tech companies from legal liability for content posted by third parties to their platforms.
"For too long, social media platforms have hidden behind Section 230 protections to censor content that deviates from their beliefs," said Sen. Roger Wicker, R-Miss., chairman of the Senate Commerce, Science and Transportation Committee Committee.
Republicans have for years decried the law as allowing the platforms to stifle conservative speech, something GOP senators emphasized at Wednesday's hearing.
"My concern is that these platforms have become powerful arbiters of what is true and what content users can access," Wicker said.
In his opening statement, Dorsey defended Twitter's moderation policy, and urged Congress to be careful in making modifications to the law.
"Removing Section 230 will remove speech from the internet," Dorsey said.
Zuckerberg signaled willingness to work with Congress in modifying laws and regulations, but also defended Facebook as a force for good. He said he does not believe tech companies should be independently making decisions about content moderation, but urged senators to modify regulations in a way that promotes "the spirit" of Section 230 - allowing companies to continue to thrive.
"Section 230 helped create the internet as we know it. It has helped new ideas get built and our companies to spread American values around the world," Zuckerberg said. "We should maintain this advantage. But the internet has also evolved and I think that Congress should update the law to make sure it is working as intended."
Sen. Ted Cruz, R-Texas, accused the three witnesses of posing "the single greatest threat to free speech in America and the greatest threat we have to free and fair elections."
"Who the hell elected you and put you in charge of what the media are allowed to report and what the American people are allowed to hear, and why do you persist in behaving as a Democratic super PAC?" Cruz demanded of Dorsey.
Dorsey pushed back, but conceding that Twitter "needs to earn more trust."
When it was Republican Sen. Ron Johnson's turn to grill Dorsey he used that comment as an attack.
"I agree with that," Johnson, of Wisconsin, said. "We don't trust you."
Throughout the hearing, Zuckerberg reiterated Facebook's commitment to protect the elections.
He told Sen. Ed Markey, D-Mass., that he would commit to banning premature declarations of victory in the 2020 election on Facebook, and also said he would strike posts encouraging violence around the election.
President Donald Trump has targeted Section 230.
In May, he signed an executive order aimed at curbing the protections the law allows social media companies after Twitter labeled two of his tweets with a fact-check label.
Both of those tweets claimed, without evidence, that voting by mail would lead to fraudulent election outcomes. Some states have been using a vote-by-mail system for years, and experts broadly say that there is no evidence that mail-in balloting leads to election fraud.
Whether Trump has the power to limit the reach of the law is unclear. Revisions to laws need to be made by Congress, giving Republicans additional ammunition for Wednesday's hearing.
During the hearing, Trump post a tweet urging repeal the act be repealed.
"So much has been learned in the last two weeks about how corrupt our Media is, and now Big Tech, maybe even worse. Repeal Section 230!" he wrote.
Democrats also have expressed concern about the way social platforms have made use of the law.
They've expressed concern that, left unregulated, the platforms have become homes to misinformation campaigns.
"Social media companies cannot be trusted to put patriotism over profit," Sen. Tammy Duckworth of Illinois said as she expressed concerns about the use of the platforms by foreign adversaries.
Democrats have stopped short of advocating for a full overhaul of the law and have instead advocated for more targeted revisions.
Sen. Richard Blumenthal, D-Conn., has been advocating for Section 230 reforms for years, but on Wednesday he admonished Republicans for staging the discussion as a political issue.
"I am appalled that my Republican colleagues are holding this hearing literally days before an election when they seem to want to bully and brow beat the platforms here to try to tilt them toward President Trump's favor," Blumenthal said.
This report was featured in the Thursday, Oct. 29, 2020, episode of “Start Here,” ABC News’ daily news podcast.
"Start Here" offers a straightforward look at the day's top stories in 20 minutes. Listen for free every weekday on Apple Podcasts, Google Podcasts, Spotify, the ABC News app or wherever you get your podcasts.