How Spammers Trick Bayesian Filters and How to Stop Them

Effectively stopping spam in the long run requires much more than blocking individual IP addresses and creating keyword-based rules that spammers often use. The increasing sophistication of spam tools coupled with the growing number of spammers in the wild has created a hyper-evolution in the variety and volume of spam. The old ways of blocking bad guys don’t work anymore.

Examining spam and spam blocking technology can shed light on how this evolution is taking place and what can be done to combat spam and reclaim email as the effective and efficient communication tool it was intended to be.

One method used to combat spam is Bayesian filtering. Named after Thomas Bayes, an English mathematician, Bayesian logic is used in decision making and inferential statistics. Bayesian archivers maintain a database of known spam and ham, or legitimate email. Once the database is large enough, the system ranks words based on how likely they are to appear in a spam message.

Words that are most likely to appear in spam receive a high score (between 51 and 100), and words that are most likely to appear in legitimate emails receive a low score (between 1 and 50). For example, the words “free” and “sex” generally have values ​​between 95 and 98, while the words “emphasis” or “disadvantage” can have a score between 1 and 4. Commonly used words such as “the” and ” that”, and new words in the Bayesian filters receive a neutral score between 40 and 50 and would not be used in the system’s algorithm.

When the system receives an email, it breaks the message down into tokens or words with assigned values. The system uses the tokens with scores at the high and low end of the range and develops a score for the email as a whole. If the email has more spam tokens than ham tokens, the email will have a high spam score. The email administrator determines a threshold score that the system uses to allow email to pass through to users.

Bayesian filters are effective at filtering out spam and minimizing false positives. Because they adapt and learn based on user feedback, Bayesian archivers produce better results as they are used within an organization over time. However, they are not infallible. Spammers have learned what words Bayesian filters consider spam and have developed ways to insert non-spam words into emails to reduce the overall spam score of the message. By adding paragraphs of text from novels or news, spammers can dilute the effects of high-ranking words. Text embedding has also caused normally legitimate words found in novels or news stories to have an inflated spam score. This can potentially make Bayesian filters less effective over time.

Another approach spammers use to fool Bayesian filters is to create fewer spam emails. For example, a spammer might send an email containing only the phrase “Here’s the link…”. This approach can neutralize the spam score and entice users to click on a link to a website that contains the spammer’s message. To block this type of spam, the filter would have to be designed to follow the link and scan the content of the website that users are meant to visit. Bayesian filters do not currently employ this type of filtering because it would be prohibitively expensive in terms of server resources and could potentially be used as a method of launching denial-of-service attacks against commercial servers.

As with all single-method spam filtering methodologies, Bayesian filters are effective against certain technical spammers who use them to trick spam filters, but they are not a magic bullet to solve the spam problem. Bayesian filters are most effective when combined with other spam detection methods.

The solution

When used individually, each anti-spam technique has been consistently outperformed by spammers. Grand schemes have been proposed to rid the world of spam, such as charging a penny for every email received or forcing servers to solve math problems before delivering email, with little success. These schemes are unrealistic and would require a large percentage of the population to adopt the same anti-spam method to be effective. You can learn more about fighting spam by visiting our website at http://www.ciphertrust.com and downloading our white papers.