Federal Labor wants an investigation into Cabinet minister Christopher Pyne's social media, after he blamed hackers for his Twitter account 'liking' an explicit gay pornographic video.

"I was hacked overnight!" Mr Pyne tweeted this morning, saying he had been asleep at 2:00am when the "like" occurred.

The activity on his Twitter account was pointed out on the social media site by other users, including Australians living overseas.

He has since removed the "like" on the pornographic image.

Labor leader Bill Shorten said he was worried about the breach of Mr Pyne's account.

"I think it is most serious when any minister, but especially a defence minister is the victim of hacking and I do think we need to get to the bottom of this," Mr Shorten said.

"There have been other problems with security the defence information of our private contractors," he pointed out.

Crossbench Senator Cory Bernardi also said the hack could have compromised national security.

As Defence Industry Minister, Mr Pyne usually uses his Twitter account to discuss military hardware or sometimes to promote his media appearances.

A censored version of the pornographic tweet that had been liked by Christopher Pyne's Twitter page.

In his tweet this morning, he suggested a potential motive for the issue overnight was, "Maybe they are making mischief over the plebiscite?" referring to the result of the national survey on allowing gay marriage.

Loading

Earlier this year, Border Force officials were asked to explain why Commissioner Roman Quaedvlieg's Twitter account liked a pornographic tweet.

United States Republican politician Ted Cruz was also forced to explain a "like" that caused a pornographic post to briefly appear on his Twitter feed in September.

The senator and 2016 presidential candidate said several aides had access to the account and one inadvertently liked a post from the account @SexuallPosts, which contained a two-minute clip from a pornographic film.

"It was a staffing issue and it was inadvertent. It was a mistake. It was not a deliberate action," Mr Cruz told reporters at the time.

Although he has since deleted it, the post was live on his page for half an hour and @SexuallPosts has since updated its Twitter description to say: "Follow for the Same Porn @TedCruz Watches".