(new Soapbox())->shout(array_map('strtoupper', $opinions)); //Shaun's blog

Me, elsewhere

Miscellaneous public code

A PHP API client for Reddit

I don't tweet much

XMPP chat
(Pidgin, Miranda, Swift, etc.)

Perfect is the enemy of good enough.

SpamAssassin 3.4.2 fixes security problems, adds HashBL and phishing plugins

Posted September 16, 2018 by shaun

New SpamAssassin 3.4.2 release

Apache has released version 3.4.2 of SpamAssassin.

Important security fixes

If you're using SpamAssassin, you should upgrade as soon as possible because this release addresses four security issues:

  • CVE-2017-15705, a malformed HTML email part may cause a denial of service through resource exhaustion;

  • CVE-2016-1238, incomplete sanitization of Perl's include path;

  • CVE-2018-11780, potential remote code execution in SpamAssassin's PDFInfo plugin;

  • CVE-2018-11781, code injection in SpamAssassin meta rule definitions

The source distribution is available directly from the Apache mirrors; RPMs and other distribution-specific packages should update in the coming days.

New features

SpamAssassin 3.4.2 introduces several new features. Two of these plugins, Mail::SpamAssassin::Plugin::HashBL and Mail::SpamAssassin::Plugin::Phishing, I can't wait to play with!

HashBL support for the EBL blocklist

A HashBL is a special type of DNS blocklist. While most anti-spam DNSBLs are geared towards querying the IP address of the sending MTA, a HashBL can be created for any arbitrary data.

One of the most common HashBLs currently in use is the EBL, or Email Blocklist. It's configured to allow queries for the hash of an email address, and will respond for email addresses that are known to be associated with scams and spam campaigns. To use the EBL, you convert an email address to lowercase, remove any +tag segments, and compute the sha1sum of the result. That hash is then used as the hostname part to query the EBL DNS server.

For example, consider this 419 scam email:

    Subject: Proposal
    To: inbox <kekesne@hivatal.kispest.hu>
    From: "Ms. Ella Golan" <kekesne@hivatal.kispest.hu>
    Date: Thu, 29 Mar 2018 18:31:53 -0700
    Reply-To: ellagln03954@foxmail.com
    Message-Id: <20180330013242.AD5A46803FD7@mikulas.south.park>

While the From address in scam messages is often forged at random, the Reply-To address is likely to remain consistent. The scammer wants to hear back from potential victims, after all. Since replies to this message are directed to ellagln03954@foxmail.com, we'd query the EBL for that address:

  1. Convert the address to lowercase (here, it's already lowercase);

  2. Remove any +tag segments from the address (here, there are none);

  3. Replace googlemail.com with gmail.com (here, not applicable);

  4. Take the sha1sum of the result:
    [user@host ~]$ echo -n 'ellagln03954@foxmail.com' | sha1sum
  5. Use that hash as the hostname part to query the EBL:

    [user@host ~]$ host 959e5a12ccbc20ae4fd18db5919c211f8c77c9b1.ebl.msbl.org
    959e5a12ccbc20ae4fd18db5919c211f8c77c9b1.ebl.msbl.org has address
    [user@host ~]$ dig +short TXT 959e5a12ccbc20ae4fd18db5919c211f8c77c9b1.ebl.msbl.org
    "AFF dropbox in Reply-to"

    The EBL returns a positive response, indicating that the 419 dropbox ellagln03954@foxmail.com is blacklisted. Addresses that aren't on the list will return NXDOMAIN.

I've been wanting to implement this for awhile (I've been meaning to blog about it for awhile, too; you can see the example message header I kept around is from 6 months ago). But until now, the only way to get EBL support in Postfix was to add yet another milter, and I have enough as it is. Now that SpamAssassin includes HashBL support, querying the EBL is as simple as turning on a plugin.

Checking PhishTank and OpenPhish

I signed up for PhishTank back in 2006, and spent some time contributing a few dozen phishing mails and verifying around 1,000 reports from other users. It's a great tool, but not something I had the inclination to keep up with by hand. Based on the usernames now submitting the majority of suspect links, most reporting to this system is now automated, and so is the ability to query it.

SpamAssassin's new Mail::SpamAssassin::Plugin::Phishing supports checking URLs found in email messages against both PhishTank and OpenPhish feeds.


If you have SpamAssassin installed through your operating system's package manager (yum, apt, etc.), it's likely that updated packages will be available this week. Otherwise, you can get the latest sources directly from the Apache SpamAssassin download page.

SpamAssassin logo by James ThompsonDidier Misson, via Wikimedia Commons

Recent articles

📰 Caveat with Vantec SATA/IDE to USB 2.0 Adapter and Macrium software

📰 Jay Niffley, Man of Mystery

📰 Compiling Doxygen on FreeBSD without LaTeX and Ghostscript

📰 Introducing Snuze, a PHP client for the Reddit API

📰 jisusaiche: Java's installer telemetry

📰 BIND client log error "query_find: query_getdb failed"

📰 Resolving "The lang/perl5.24 port has been deleted: Has expired" portmaster error

📰 Armagaddon2 interim fix for Firefox 56 and other old versions

📰 Strange DNS queries: qname "miep", qtype ANY

📰 Undeliverable as addressed: A massive broken spam campaign?

📰 Using WITH_META_MODE and ccache for FreeBSD build boosts

📰 Resolving subversion error E000013: Unable to create pristine install stream

📰 Enhancements to SmokePing's AnotherDNS probe

📰 Generating vanity DNSSEC key tags

📰 DDoS involving forged packets from

▲ Back to top | Permalink to this page