Here's a Facebook hack straight from the pages of the novel 1984: A way to rewrite the record of the past.
"Who controls the past controls the future: who controls the present controls the past," went the ruling party's slogan in George Orwell's dystopian novel.
Security researchers have found a way to control the past, by altering Facebook's logs of online chats conducted through its website and Messenger App.
Such modified logs could be used to control the future, the researchers suggest, by using them to commit fraud, to falsify evidence in legal investigations, or to introduce malware onto a PC or phone.
Roman Zaikin of Check Point Software Technologies discovered a flaw in Facebook's chat system that made it possible for an attacker to modify or remove any sent message, photo, file or link in a conversation they were part of.
He demonstrated in a video how he could change an earlier message from an innocent "Hi!" to what could be a link to ransomware attack.
But the chat logs could just as easily have been modified to create (or suppress) evidence of a spouse's unreasonable behavior in child custody battles, or any number of other scenarios.
Needing to be part of the conversation might seem a major limitation, but if attackers are somehow able to gain control of someone else's PC or Facebook account, then they are also able to modify all of that person's chat histories with other Facebook users.
"These chats can be admitted as evidence in legal investigations and this vulnerability opens the door for an attacker to hide evidence of a crime or even incriminate an innocent person," Check Point researchers wrote Tuesday, in a blog post describing the flaw.
The researchers found that each message in Facebook's chat applications is identified by a "message_id" parameter.
Given this identifier, it is possible to send instructions to Facebook's servers to modify the message. This can be done by sending the changed message with the old identifier using common website debugging tools to alter the commands Facebook's own website used to send the chat messages in the first place, as Check Point's Zaikin demonstrated. The change in the log happens invisibly, without a fresh notification being sent to devices participating in the conversation.
The problem, Facebook explained in its own blog post about the flaw, was that some implementations of its chat service handled messages with the same identifier in different ways. Most ignored later occurrences of an identifier, showing only the oldest, making it impossible to modify the chat history displayed using Zaikin's technique.
However, the Android version of the Messenger app discarded earlier occurrences of an identifier, displaying only the newest, thus making it appear that the log had been modified.
"This bug affected the Android Messenger interface, but the message content was still correctly reflected on other platforms," Facebook said. Modified messages still went through Facebook's anti-malware and anti-spam filters, the company said, so the bug did not allow sending of malicious content that would have been blocked in the original message, the company said, adding that the threat posed by the flaw was further limited because, "The content self-corrected on Android when the application refetched message data from the server, so it wasn't permanently changed."
Check Point played down that aspect in its post, suggesting that a "hacker could implement automation techniques to continually outsmart security measures for long-term chat alterations," although if a hacker had that much control of someone's phone, a modified Facebook chat log would probably be the least of their worries.
Happily for future users of the Messenger app, Facebook has rewritten its past code to fix the flaw since being informed of it earlier this month, the vulnerability, the security company said in its blog post.
But if Check Point wasn't the first to spot the vulnerability, who knows what changes have already been made in the myriad documents composing our modern history? Has Oceania, as Orwell wrote, really always been at war with Eastasia?