Facebook said on Tuesday that it is investigating unsolicited images and videos that hit some users' accounts this week.

The images and videos depicting pornography and violence have hit some people's Facebook newsfeeds in recent days. Facebook users were tricked into pasting a javascript code in their browser URL bar, which led to them sharing the content.

Facebook described the spam attack "coordinated" and said that it had exploited a browser vulnerability.

Facebook engineers have been working to reduce this browser vulnerability, the company added.