|
|
Subscribe / Log in / New account

Security

A look at Rspamd

By Nathan Willis
July 1, 2015

SpamAssassin has been the dominant spam-filtering program in the free-software community for at least a decade. But the relative newcomer Rspamd is making significant gains, and may be a project worth serious consideration by those running email servers. It is designed to be easier to extend with new functionality, and the architecture supports running multiple, parallel processes even on clusters.

Vsevolod Stakhov started work on Rspamd in 2010 with the goal of building a more modular alternative to SpamAssassin—both in the architecture of program and in how its spam-filtering tests are designed. The latest major release was version 0.9.0 in May, which added support for native SpamAssassin rules, Domain-based Message Authentication, Reporting and Conformance (DMARC), and many other improvements. A series of minor updates have followed, the latest being 0.9.8 on June 25. The program is packaged for Debian, Ubuntu, Fedora, openSUSE, and is available in the FreeBSD ports collection.

Regarding its modular architecture, Rspamd is designed to run in multiple processes, with one controller process coordinating several workers that may be running locally or on other machines. The workers can each handle a separate task, such as performing statistical analysis of message content or conducting traditional rule-based filtering. The various processes communicate over HTTPS. The system is event-driven, with the intent to not block anywhere in the code, so that it can process many incoming messages simultaneously.

As for the actual spam-filtering tests, Rspamd's core modules are written in C, but the project also supports a flexible system for writing new filters as Lua plugins. The documentation lists eight Lua modules that ship with the default release. They include support for real-time blacklists (RBLs), recognizing common mailing-list signatures, detecting phishing URLs, and more.

The C modules, though, constitute what the project considers the core filtering functionality. They include support for Sender Policy Framework (SPF) validation checking, SURBL blacklists, DomainKeys Identified Mail (DKIM), and more. Like SpamAssassin, Rspamd uses the output of its various filters to assign a score to each message, indicating the likelihood that it is spam. The central filtering tool is a regular-expression engine that scans message body and header content, much like the one found in SpamAssassin.

In fact, there is a separate plugin available that lets one use unaltered SpamAssassin rules with Rspamd. But one difference that the Rpsamd project takes particular pride in is that it can support more sophisticated rules. Its expression-matching engine uses a more complex classifier than the traditional, single-word Bayesian algorithm used in SpamAssassin. Rspamd's algorithm, known as OSB-Bayes (for "Orthogonal Sparse Bigrams") was originally described in a 2006 paper [PDF].

In essence, OSB-Bayes adjusts the "spam probability" factor calculated for a message by de-emphasizing those trigger features (such as suspicious words) that seem to be evenly distributed in a message and emphasizing those trigger features that appear in clusters. The purported advantage is that this approach detects trigger features that are found in statistically unlikely groups, minimizing the "noise" caused by features that one would expect to find, randomly, spread out over the whole message. Rspamd's implementation uses five-word chunks, skipping small words. The process of tuning the implementation has been an ongoing one; the 0.9.0 release notes mention that the latest revisions significantly reduced the false-positive rate.

One of the other core modules implements the fuzzy hash-checking filter. This filter uses the Shingles algorithm (which chops up the text into chunks and searches for matches) to detect phrases that are similar to, but not exact matches for, suspected spam content. Rspamd provides separate fuzzy storage workers to save the hashes calculated on incoming message contents to a local database. That allows the fuzzy-checking module to learn based on a mail server's particular message traffic. Storing the hashes rather than plain text, of course, has privacy benefits.

All the filtering features in the world mean nothing if the system cannot be used in the real world, however. On the deployment front, Rspamd offers an SMTP proxy mode that can be used as an intermediary between any Mail Transfer Agent (MTA) and Mail User Agent (MUA)—although most users will probably prefer to take advantage of the direct MTA integration features. Currently, Rspamd supports integration with Exim, Postfix, Sendmail, and Haraka.

Postfix and Sendmail integration relies on Stakhov's rmilter mail filter. Haraka includes an Rspamd plugin, while Exim integration requires patching the Exim source in several places.

One other distinction between Rspamd and SpamAssassin is that Rspamd includes a web-based administration interface. It allows the user to monitor the status of worker processes, see statistics about the incoming mail traffic, and adjust several of the configuration knobs for calculating filter scores and triggering the resultant actions. There are several competing web interfaces for SpamAssassin, although they are developed by third parties.

Rspamd has certainly not supplanted SpamAssassin for many system administrators, although the project's documentation and release notes frequently mention that it is in use in real-world, high-volume deployments. In 2013, Stakhov told the SpamAssassin mailing list that he had originally written Rspamd for a single client, and has been in the process of growing the project since.

Whatever its origins, one does increasingly see it mentioned in discussions and blog posts about spam filtering—particularly for running a personal mail server, which bodes well for the long-term future. Smaller deployments are often less risky, but they are frequently how a new project gains a foothold with administrators. The project is also a 2015 Google Summer of Code mentoring organization. Between those factors and the rapid pace of development over the past year or two, Rspamd appears to be a healthy project on firm footing—one that mail server administrators might be wise to keep an eye on.

Comments (7 posted)

Brief items

Security quotes of the week

We demonstrate the extraction of secret decryption keys from laptop computers, by nonintrusively measuring electromagnetic emanations for a few seconds from a distance of 50 cm. The attack can be executed using cheap and readily-available equipment: a consumer-grade radio receiver or a Software Defined Radio USB dongle. The setup is compact and can operate untethered; it can be easily concealed, e.g., inside pita bread. Common laptops, and popular implementations of RSA and ElGamal encryptions, are vulnerable to this attack, including those that implement the decryption using modern exponentiation algorithms such as sliding-window, or even its side-channel resistant variant, fixed-window (m-ary) exponentiation.
Daniel Genkin, Lev Pachmanov, Itamar Pipman, and Eran Tromer in "Stealing Keys from PCs using a Radio: Cheap Electromagnetic Attacks on Windowed Exponentiation"

The study of fourteen popular VPN [virtual private network] providers found that eleven of them leaked information about the user because of a vulnerability known as ‘IPv6 leakage’. The leaked information ranged from the websites a user is accessing to the actual content of user communications, for example comments being posted on forums. Interactions with websites running HTTPS encryption, which includes financial transactions, were not leaked.
Queen Mary University of London reports on a VPN study

Comments (5 posted)

New vulnerabilities

cacti: two vulnerabilities

Package(s):cacti CVE #(s):CVE-2015-2665 CVE-2015-4454
Created:June 25, 2015 Updated:July 1, 2015
Description: From the Red Hat bugzilla entries:

CVE-2015-2665: Cross-site scripting (XSS) vulnerability in Cacti before 0.8.8d allows remote attackers to inject arbitrary web script or HTML via unspecified vectors.

CVE-2015-4454: SQL injection vulnerability in the get_hash_graph_template function in lib/functions.php in Cacti before 0.8.8d allows remote attackers to execute arbitrary SQL commands via the graph_template_id parameter to graph_templates.php.

Alerts:
Fedora FEDORA-2016-4a5ce6a6c0 cacti 2016-05-04
Fedora FEDORA-2016-a8e2be0fe6 cacti 2016-05-04
Mageia MGASA-2015-0306 cacti 2015-08-10
Debian-LTS DLA-255-1 cacti 2015-06-27
Debian DSA-3295-1 cacti 2015-06-24

Comments (none posted)

chicken: out-of-bounds read

Package(s):chicken CVE #(s):CVE-2015-4556
Created:June 30, 2015 Updated:July 1, 2015
Description: From the Red Hat bugzilla:

It was discovered that the string-translate* procedure from the data-structures unit can scan beyond the input string's length up to the length of the source strings in the map that's passed to string-translate*. This issue was fixed in master 8a46020, and it will make its way into CHICKEN 4.10.

Alerts:
Gentoo 201612-54 chicken 2016-12-31
Fedora FEDORA-2015-10165 chicken 2015-06-30
Fedora FEDORA-2015-10333 chicken 2015-06-30

Comments (none posted)

chromium-browser: code execution

Package(s):chromium-browser CVE #(s):CVE-2015-1266 CVE-2015-1267 CVE-2015-1268 CVE-2015-1269
Created:June 25, 2015 Updated:November 2, 2015
Description: From the Red Hat advisory:

Several flaws were found in the processing of malformed web content. A web page containing malicious content could cause Chromium to crash or, potentially, execute arbitrary code with the privileges of the user running Chromium. (CVE-2015-1266, CVE-2015-1267, CVE-2015-1268, CVE-2015-1269)

Alerts:
openSUSE openSUSE-SU-2015:1872-1 chromium 2015-11-02
Debian DSA-3315-1 chromium-browser 2015-07-24
Gentoo 201507-18 chromium 2015-07-10
Mageia MGASA-2015-0265 chromium-browser 2015-07-05
Ubuntu USN-2652-1 oxide-qt 2015-06-30
openSUSE openSUSE-SU-2015:1146-1 chromium 2015-06-26
Red Hat RHSA-2015:1188-01 chromium-browser 2015-06-25

Comments (none posted)

cups-x2go: multiple vulnerabilities

Package(s):cups-x2go CVE #(s):
Created:July 1, 2015 Updated:July 13, 2015
Description: CUPS X2Go (3.0.1.3) fixes multiple vulnerabilities. See the CUPS X2Go (3.0.1.3) release announcement for details.
Alerts:
Fedora FEDORA-2015-10450 cups-x2go 2015-07-10
Fedora FEDORA-2015-10459 cups-x2go 2015-06-30

Comments (none posted)

elfutils: unspecified vulnerabilities

Package(s):elfutils CVE #(s):
Created:July 1, 2015 Updated:July 1, 2015
Description: Alexander Cherepanov reported several crashes as the result of running a set of fuzzing tests against binutils. Some of these crashes might conceivably be exploitable via a crafted ELF binary file.
Alerts:
Fedora FEDORA-2015-10370 elfutils 2015-06-30

Comments (none posted)

kernel: denial of service

Package(s):kernel CVE #(s):CVE-2015-4692
Created:June 29, 2015 Updated:July 1, 2015
Description: From the Red Hat bugzilla:

Linux kernel built for the x86 architecture, with the KVM virtualisation support(CONFIG_KVM) is vulnerable to a NULL pointer dereference flaw. It could occur while doing KVM's Virtual CPU ioctl(2) call, in Linux kernel's kvm_apic_has_events() function.

An unprivileged user able to access "/dev/kvm" device, could use this flaw to crash the system kernel resulting in DoS.

Alerts:
openSUSE openSUSE-SU-2016:0301-1 kernel 2016-02-01
Mageia MGASA-2016-0015 kernel-tmb 2016-01-14
Mageia MGASA-2015-0390 kernel-linus 2015-10-09
Mageia MGASA-2015-0386 kernel 2015-09-30
openSUSE openSUSE-SU-2015:1382-1 kernel 2015-08-14
Debian DSA-3329-1 kernel 2015-08-07
SUSE SUSE-SU-2015:1324-1 kernel 2015-07-31
Ubuntu USN-2683-1 linux-lts-vivid 2015-07-23
Ubuntu USN-2682-1 linux-lts-utopic 2015-07-23
Ubuntu USN-2680-1 linux-lts-trusty 2015-07-23
Ubuntu USN-2684-1 kernel 2015-07-23
Ubuntu USN-2685-1 kernel 2015-07-23
Ubuntu USN-2681-1 kernel 2015-07-23
Fedora FEDORA-2015-10678 kernel 2015-06-30
Fedora FEDORA-2015-10677 kernel 2015-06-27

Comments (none posted)

libcrypto++: information disclosure

Package(s):libcrypto++ CVE #(s):CVE-2015-2141
Created:June 29, 2015 Updated:August 24, 2015
Description: From the Debian advisory:

Evgeny Sidorov discovered that libcrypto++, a general purpose C++ cryptographic library, did not properly implement blinding to mask private key operations for the Rabin-Williams digital signature algorithm. This could allow remote attackers to mount a timing attack and retrieve the user's private key.

Alerts:
Mageia MGASA-2015-0317 libcryptopp 2015-08-21
Arch Linux ASA-201507-20 crypto++ 2015-07-24
openSUSE openSUSE-SU-2015:1271-1 libcryptopp 2015-07-20
Fedora FEDORA-2015-10914 cryptopp 2015-07-16
Fedora FEDORA-2015-10911 cryptopp 2015-07-16
Debian-LTS DLA-262-1 libcrypto++ 2015-06-30
Debian DSA-3296-1 libcrypto++ 2015-06-29

Comments (none posted)

librack-ruby: denial of service

Package(s):librack-ruby CVE #(s):CVE-2015-3225
Created:June 26, 2015 Updated:December 22, 2015
Description:

From the Debian advisory:

There is a potential denial of service vulnerability in Rack, a modular Ruby webserver interface.

Carefully crafted requests can cause a `SystemStackError` and cause a denial of service attack by exploiting the lack of a sensible depth check when doing parameter normalization.

Alerts:
Scientific Linux SLSA-2015:2290-1 pcs 2015-12-21
Red Hat RHSA-2015:2290-01 pcs 2015-11-19
Fedora FEDORA-2015-12978 rubygem-rack 2015-08-19
Debian DSA-3322-1 ruby-rack 2015-07-31
Mageia MGASA-2015-0346 ruby-rack 2015-09-08
Fedora FEDORA-2015-12979 rubygem-rack 2015-08-27
openSUSE openSUSE-SU-2015:1262-1 rubygem-rack-1_4 2015-07-17
openSUSE openSUSE-SU-2015:1263-1 rubygem-rack-1_3 2015-07-17
openSUSE openSUSE-SU-2015:1259-1 rubygem-rack 2015-07-17
Debian-LTS DLA-254-1 librack-ruby 2015-06-26

Comments (none posted)

libwmf: denial of service

Package(s):libwmf CVE #(s):CVE-2015-4695 CVE-2015-4696
Created:June 29, 2015 Updated:October 5, 2015
Description: From the Debian LTS advisory:

libwmf is vulnerable to two denial of service due to invalid read operations when processing specially crafted WMF files.

CVE-2015-4695: Heap buffer overread in libwmf

CVE-2015-4696: Read after free() in wmf2gd/wmf2eps

Alerts:
Arch Linux ASA-201701-1 libwmf 2017-01-01
Gentoo 201602-03 libwmf 2016-02-27
Scientific Linux SLSA-2015:1917-1 libwmf 2015-10-20
Oracle ELSA-2015-1917 libwmf 2015-10-20
Oracle ELSA-2015-1917 libwmf 2015-10-20
CentOS CESA-2015:1917 libwmf 2015-10-20
CentOS CESA-2015:1917 libwmf 2015-10-20
Red Hat RHSA-2015:1917-01 libwmf 2015-10-20
Fedora FEDORA-2015-14848 libwmf 2015-10-03
Fedora FEDORA-2015-10601 libwmf 2015-07-30
Fedora FEDORA-2015-10627 libwmf 2015-07-10
openSUSE openSUSE-SU-2015:1212-1 libwmf 2015-07-09
Ubuntu USN-2670-1 libwmf 2015-07-08
Debian DSA-3302-1 libwmf 2015-07-06
Mageia MGASA-2015-0261 libwmf 2015-07-05
Debian-LTS DLA-257-1 libwmf 2015-06-29

Comments (none posted)

pam: denial of service

Package(s):pam CVE #(s):CVE-2015-3238
Created:July 1, 2015 Updated:July 6, 2015
Description: From the Red Hat bugzilla:

From the original report:
"If SELinux is enabled, the _unix_run_helper_binary function in Linux-PAM 1.1.8 and earlier hangs indefinitely when verifying a password of 65536 characters, which allows attackers to conduct username enumeration and denial of service attacks.

When supplying a password of 65536 characters or more, the process will block on the write(2) call at modules/pam_unix/support.c:614 because it tries to write strlen(passwd)+1 bytes to a blocking pipe and a pipe has a limited capacity of 65536 bytes on Linux."

Alerts:
Gentoo 201605-05 pam 2016-05-31
Ubuntu USN-2935-3 pam 2016-03-17
Ubuntu USN-2935-2 pam 2016-03-16
Ubuntu USN-2935-1 pam 2016-03-16
Scientific Linux SLSA-2015:1640-1 pam 2015-08-19
CentOS CESA-2015:1640 pam 2015-08-18
CentOS CESA-2015:1640 pam 2015-08-18
Oracle ELSA-2015-1640 pam 2015-08-18
Oracle ELSA-2015-1640 pam 2015-08-18
Red Hat RHSA-2015:1640-01 pam 2015-08-18
Mageia MGASA-2015-0266 pam 2015-07-05
Fedora FEDORA-2015-10830 pam 2015-06-30
Fedora FEDORA-2015-10848 pam 2015-07-03

Comments (none posted)

php-htmLawed: multiple vulnerabilities

Package(s):php-htmLawed CVE #(s):
Created:June 30, 2015 Updated:July 1, 2015
Description: From the Fedora advisory:

Fix for a potential security vulnerability arising from unescaped double-quote character in single-quoted attribute value of some deprecated elements when tag transformation is enabled; recognition for non-(HTML4) standard 'allowfullscreen' attribute of 'iframe.'

Alerts:
Fedora FEDORA-2015-10169 php-htmLawed 2015-06-30
Fedora FEDORA-2015-10139 php-htmLawed 2015-06-30

Comments (none posted)

python-jwt: token verification bypass

Package(s):python-jwt CVE #(s):
Created:June 30, 2015 Updated:July 1, 2015
Description: From the Red Hat bugzilla:

If the secretKey was expected to be a RSA public key, but the attacker changed the header to indicate a signature algorithm of HMAC, the RSA public key would be used as the signing secret.

Alerts:
Fedora FEDORA-2015-10249 python-jwt 2015-06-30
Fedora FEDORA-2015-10350 python-jwt 2015-06-30

Comments (none posted)

roundcubemail: two vulnerabilities

Package(s):roundcubemail CVE #(s):CVE-2015-2180 CVE-2015-2181
Created:June 29, 2015 Updated:May 2, 2016
Description: From the openSUSE advisory:

roundcubemail was updated to version 1.0.6 to fix many minor bugs and two security issues.

The security-related fixes in particular are:

  • security improvement in DBMail driver of password plugin
  • security improvement in contact photo handling

The second openSUSE advisory notes that both CVEs pertain to the first issue.

Alerts:
openSUSE openSUSE-SU-2016:2127-1 roundcubemail 2016-08-22
openSUSE openSUSE-SU-2016:2109-1 roundcubemail 2016-08-19
openSUSE openSUSE-SU-2016:2108-1 roundcubemail 2016-08-19
Mageia MGASA-2016-0155 roundcubemail 2016-04-29
Fedora FEDORA-2016-a9c8f9dcff roundcubemail 2016-05-01
Fedora FEDORA-2016-69eb7f9fb2 roundcubemail 2016-04-30
openSUSE openSUSE-SU-2016:3038-1 roundcubemail 2016-12-07
Mageia MGASA-2015-0400 roundcubemail 2015-10-14
openSUSE openSUSE-SU-2015:1240-1 roundcubemail 2015-07-14
openSUSE openSUSE-SU-2015:1155-1 roundcubemail 2015-06-29

Comments (none posted)

rubygem-activesupport: two vulnerabilities

Package(s):rubygem-activesupport CVE #(s):CVE-2015-3226 CVE-2015-3227
Created:July 1, 2015 Updated:February 1, 2016
Description: From the Red Hat bugzilla:

CVE-2015-3226: There is an XSS vulnerability in the ActiveSupport::JSON.encode method in Ruby on Rails.

When a `Hash` containing user-controlled data is encode as JSON (either through `Hash#to_json` or `ActiveSupport::JSON.encode`), Rails does not perform adequate escaping that matches the guarantee implied by the `escape_html_entities_in_json` option (which is enabled by default). If this resulting JSON string is subsequently inserted directly into an HTML page, the page will be vulnerable to XSS attacks.

CVE-2015-3227: A possible denial of service attack in the XML processing in Active Support has been reported.

Specially crafted XML documents can cause applications to raise a `SystemStackError` and potentially cause a denial of service attack. This only impacts applications using REXML or JDOM as their XML processor. Other XML processors that Rails supports are not impacted.

Alerts:
Debian-LTS DLA-603-1 ruby-activesupport-3.2 2016-08-27
Debian DSA-3464-1 rails 2016-01-31
openSUSE openSUSE-SU-2015:1279-1 rubygem-activesupport-3_2 2015-07-22
Fedora FEDORA-2015-10545 rubygem-activesupport 2015-06-30
Fedora FEDORA-2015-10538 rubygem-activesupport 2015-06-30

Comments (none posted)

rubygem-jquery-rails: CSRF vulnerability

Package(s):rubygem-jquery-rails CVE #(s):CVE-2015-1840
Created:June 30, 2015 Updated:July 20, 2015
Description: From the Red Hat bugzilla:

There's a vulnerability in jquery-ujs and jquery-rails that can be used to bypass CSP protections and allows attackers to send CSRF tokens to attacker domains.

In the scenario where an attacker might be able to control the href attribute of an anchor tag or the action attribute of a form tag that will trigger a POST action, the attacker can set the href or action to " https://attacker.com" (note the leading space) that will be passed to JQuery, who will see this as a same origin request, and send the user's CSRF token to the attacker domain.

Alerts:
openSUSE openSUSE-SU-2015:1260-1 rubygem-jquery-rails 2015-07-17
Fedora FEDORA-2015-10144 rubygem-jquery-rails 2015-06-30
Fedora FEDORA-2015-10258 rubygem-jquery-rails 2015-06-30

Comments (none posted)

rubygem-web-console: code execution

Package(s):rubygem-web-console CVE #(s):CVE-2015-3224
Created:June 30, 2015 Updated:July 1, 2015
Description: From the Red Hat bugzilla:

There is a remote code execution vulnerability in Web Console.

Specially crafted remote requests can spoof their origin, bypassing the IP whitelist, in any environment where Web Console is enabled (development and test, by default).

Users whose application is only accessible from localhost (as is the default behaviour in Rails 4.2) are not affected, unless a local proxy is involved.

Alerts:
Fedora FEDORA-2015-10128 rubygem-web-console 2015-06-30

Comments (none posted)

unattended-upgrades: authentication bypass

Package(s):unattended-upgrades CVE #(s):CVE-2015-1330
Created:June 30, 2015 Updated:July 2, 2015
Description: From the Debian advisory:

It was discovered that unattended-upgrades, a script for automatic installation of security upgrades, did not properly authenticate downloaded packages when the force-confold or force-confnew dpkg options were enabled via the DPkg::Options::* apt configuration.

Alerts:
Debian-LTS DLA-265-1 unattended-upgrades 2015-07-02
Ubuntu USN-2657-1 unattended-upgrades 2015-06-29
Debian DSA-3297-1 unattended-upgrades 2015-06-29

Comments (none posted)

Page editor: Jake Edge
Next page: Kernel development>>


Copyright © 2015, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds