The Cape Argus reported the attack occurred on Saturday night, with the tweet proclaiming the “fastest way for processing fat off your body in two weeks” and providing a link to a dieting website.
Spokesman Brian Dube said the account had now been secured and passwords changed.
Tweeters were quick to seize upon the irony of the attacks, with Gaye Davis tweeting: “Ooh, hope the password wasn't 'secret', hey.”
Democratic Alliance (DA) defence spokesman David Maynier reportedly joked that though the dieting website offered good advice it would be perverse for the department to consider South Africa’s diet a security concern.
“One would expect that the department responsible for protecting the state from cyber attacks would be hacker proof,” he said, as quoted by the Cape Argus.