Based on a tweet by the Twitter account Ask PlayStation UK, those that are still affected can fix this on their own by deleting the offending message via the PS app, going into the PS4’s Safe Mode, and selecting option 5, which refers to rebuilding the database of the console.
— Ask PlayStation UK (@AskPS_UK) October 15, 2018 Because there are no other details of the fix, it’s entirely possible for another message of similar nature to surface in the future. Of course, this means that the best way to prevent this from happening is to change your privacy settings so that strangers will not be able to send you messages. (Source: Ask PLayStation UK / Twitter)