Security Experts:

Facebook Flaws Allowed Attackers to Delete Users’ Comments

A combination of vulnerabilities could have allowed a malicious hacker to delete any comment on Facebook, according to a researcher.

Joe Balhis, a 19-year-old researcher from Lebanon who has been working with Germany-based Vulnerability Lab, discovered that he could remove comments posted by users on Facebook by leveraging a session validation flaw and a cross-site request forgery (CSRF) vulnerability.

An advisory published by Vulnerability Lab shows that an attacker could have deleted any comment simply by replacing the values of the comment_id and legacy_id parameters in a request.

The first step of the attack involved posting a random comment on Facebook, deleting it, and capturing the header information from the delete request. In the next phase, the attacker likes the comment he wants to remove, and captures the request in order to obtain the value of the comment_id and legacy_id associated with the targeted comment.

Finally, the attacker sends a comment delete request to Facebook in which the values of the comment_id and legacy_id parameters are replaced with the ones of the targeted comment.

A malicious hacker could have created a script to automate the attack and delete a large number of comments by guessing comment_id values, Balhis told SecurityWeek.

“If I entered a random id and it was the id of an existing comment, it would be deleted permanently,” the expert said.

The issue was reported and patched in 2014, but the researcher decided not to release the details of the vulnerability until now. Facebook awarded Balhis a $12,500 bounty.

Before the social media giant addressed the issue, there was no way for users to protect themselves against such attacks, Balhis said.

“The victim (target) user account can't do anything. He can't protect his comments. I need his comment id and it is easy to get [from] the source of Facebook,” the researcher explained via email. “Ever when you visit a Facebook post you can see in the source of the site the user specific comment ids.”

The expert noted that a malicious actor did not require access to the victim’s profile. The attack worked even against users who were not friends with the attacker, and users with private profiles.

A proof-of-concept video that shows the attack step by step has been made available by Vulnerability Lab.

Last week, researcher Laxman Muthiyah reported getting a $12,500 bounty from Facebook for identifying a Graph API vulnerability that could have been exploited to delete users’ photo albums.

view counter
Eduard Kovacs (@EduardKovacs) is a contributing editor at SecurityWeek. He worked as a high school IT teacher for two years before starting a career in journalism as Softpedia’s security news reporter. Eduard holds a bachelor’s degree in industrial informatics and a master’s degree in computer techniques applied in electrical engineering.