Vulnerabilities > CVE-2020-1931 - OS Command Injection vulnerability in Apache Spamassassin

047910
CVSS 8.1 - HIGH
Attack vector
NETWORK
Attack complexity
HIGH
Privileges required
NONE
Confidentiality impact
HIGH
Integrity impact
HIGH
Availability impact
HIGH
network
high complexity
apache
CWE-78
nessus

Summary

A command execution issue was found in Apache SpamAssassin prior to 3.4.3. Carefully crafted nefarious Configuration (.cf) files can be configured to run system commands similar to CVE-2018-11805. This issue is less stealthy and attempts to exploit the issue will throw warnings. Thanks to Damian Lukowski at credativ for reporting the issue ethically. With this bug unpatched, exploits can be injected in a number of scenarios though doing so remotely is difficult. In addition to upgrading to SA 3.4.4, we again recommend that users should only use update channels or 3rd party .cf files from trusted places.

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Command Line Execution through SQL Injection
    An attacker uses standard SQL injection methods to inject data into the command line for execution. This could be done directly through misuse of directives such as MSSQL_xp_cmdshell or indirectly through injection of data into the database that would be interpreted as shell commands. Sometime later, an unscrupulous backend application (or could be part of the functionality of the same application) fetches the injected data stored in the database and uses this data as command line arguments without performing proper validation. The malicious data escapes that data plane by spawning new commands to be executed on the host.
  • Command Delimiters
    An attack of this type exploits a programs' vulnerabilities that allows an attacker's commands to be concatenated onto a legitimate command with the intent of targeting other resources such as the file system or database. The system that uses a filter or a blacklist input validation, as opposed to whitelist validation is vulnerable to an attacker who predicts delimiters (or combinations of delimiters) not present in the filter or blacklist. As with other injection attacks, the attacker uses the command delimiter payload as an entry point to tunnel through the application and activate additional attacks through SQL queries, shell commands, network scanning, and so on.
  • Exploiting Multiple Input Interpretation Layers
    An attacker supplies the target software with input data that contains sequences of special characters designed to bypass input validation logic. This exploit relies on the target making multiples passes over the input data and processing a "layer" of special characters with each pass. In this manner, the attacker can disguise input that would otherwise be rejected as invalid by concealing it with layers of special/escape characters that are stripped off by subsequent processing steps. The goal is to first discover cases where the input validation layer executes before one or more parsing layers. That is, user input may go through the following logic in an application: In such cases, the attacker will need to provide input that will pass through the input validator, but after passing through parser2, will be converted into something that the input validator was supposed to stop.
  • Argument Injection
    An attacker changes the behavior or state of a targeted application through injecting data or command syntax through the targets use of non-validated and non-filtered arguments of exposed services or methods.
  • OS Command Injection
    In this type of an attack, an adversary injects operating system commands into existing application functions. An application that uses untrusted input to build command strings is vulnerable. An adversary can leverage OS command injection in an application to elevate privileges, execute arbitrary commands and compromise the underlying operating system.

Nessus

  • NASL familySuSE Local Security Checks
    NASL idOPENSUSE-2020-446.NASL
    descriptionThis update for spamassassin fixes the following issues : Security issues fixed : - CVE-2018-11805: Fixed an issue with delimiter handling in rule files related to is_regexp_valid() (bsc#1118987). - CVE-2020-1930: Fixed an issue with rule configuration (.cf) files which can be configured to run system commands (bsc#1162197). - CVE-2020-1931: Fixed an issue with rule configuration (.cf) files which can be configured to run system commands with warnings (bsc#1162200). Non-security issue fixed : - Altering hash requires restarting loop (bsc#862963). This update was imported from the SUSE:SLE-15-SP1:Update update project.
    last seen2020-04-10
    modified2020-04-06
    plugin id135221
    published2020-04-06
    reporterThis script is Copyright (C) 2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/135221
    titleopenSUSE Security Update : spamassassin (openSUSE-2020-446)
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were
    # extracted from openSUSE Security Update openSUSE-2020-446.
    #
    # The text description of this plugin is (C) SUSE LLC.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(135221);
      script_version("1.2");
      script_set_attribute(attribute:"plugin_modification_date", value:"2020/04/08");
    
      script_cve_id("CVE-2018-11805", "CVE-2020-1930", "CVE-2020-1931");
    
      script_name(english:"openSUSE Security Update : spamassassin (openSUSE-2020-446)");
      script_summary(english:"Check for the openSUSE-2020-446 patch");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote openSUSE host is missing a security update."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "This update for spamassassin fixes the following issues :
    
    Security issues fixed :
    
      - CVE-2018-11805: Fixed an issue with delimiter handling
        in rule files related to is_regexp_valid()
        (bsc#1118987).
    
      - CVE-2020-1930: Fixed an issue with rule configuration
        (.cf) files which can be configured to run system
        commands (bsc#1162197).
    
      - CVE-2020-1931: Fixed an issue with rule configuration
        (.cf) files which can be configured to run system
        commands with warnings (bsc#1162200). Non-security issue
        fixed :
    
      - Altering hash requires restarting loop (bsc#862963).
    
    This update was imported from the SUSE:SLE-15-SP1:Update update
    project."
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.opensuse.org/show_bug.cgi?id=1118987"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.opensuse.org/show_bug.cgi?id=1162197"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.opensuse.org/show_bug.cgi?id=1162200"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.opensuse.org/show_bug.cgi?id=862963"
      );
      script_set_attribute(
        attribute:"solution", 
        value:"Update the affected spamassassin packages."
      );
      script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:N/C:C/I:C/A:C");
      script_set_cvss_temporal_vector("CVSS2#E:U/RL:OF/RC:C");
      script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H");
      script_set_cvss3_temporal_vector("CVSS:3.0/E:U/RL:O/RC:C");
      script_set_attribute(attribute:"exploitability_ease", value:"No known exploits are available");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:perl-Mail-SpamAssassin");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:perl-Mail-SpamAssassin-Plugin-iXhash2");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:spamassassin");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:spamassassin-debuginfo");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:spamassassin-debugsource");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:novell:opensuse:15.1");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2019/12/12");
      script_set_attribute(attribute:"patch_publication_date", value:"2020/04/04");
      script_set_attribute(attribute:"plugin_publication_date", value:"2020/04/06");
      script_set_attribute(attribute:"generated_plugin", value:"current");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2020 and is owned by Tenable, Inc. or an Affiliate thereof.");
      script_family(english:"SuSE Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/SuSE/release", "Host/SuSE/rpm-list", "Host/cpu");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("global_settings.inc");
    include("rpm.inc");
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    release = get_kb_item("Host/SuSE/release");
    if (isnull(release) || release =~ "^(SLED|SLES)") audit(AUDIT_OS_NOT, "openSUSE");
    if (release !~ "^(SUSE15\.1)$") audit(AUDIT_OS_RELEASE_NOT, "openSUSE", "15.1", release);
    if (!get_kb_item("Host/SuSE/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    ourarch = get_kb_item("Host/cpu");
    if (!ourarch) audit(AUDIT_UNKNOWN_ARCH);
    if (ourarch !~ "^(x86_64)$") audit(AUDIT_ARCH_NOT, "x86_64", ourarch);
    
    flag = 0;
    
    if ( rpm_check(release:"SUSE15.1", reference:"perl-Mail-SpamAssassin-3.4.2-lp151.8.3.1") ) flag++;
    if ( rpm_check(release:"SUSE15.1", reference:"perl-Mail-SpamAssassin-Plugin-iXhash2-2.05-lp151.8.3.1") ) flag++;
    if ( rpm_check(release:"SUSE15.1", reference:"spamassassin-3.4.2-lp151.8.3.1") ) flag++;
    if ( rpm_check(release:"SUSE15.1", reference:"spamassassin-debuginfo-3.4.2-lp151.8.3.1") ) flag++;
    if ( rpm_check(release:"SUSE15.1", reference:"spamassassin-debugsource-3.4.2-lp151.8.3.1") ) flag++;
    
    if (flag)
    {
      if (report_verbosity > 0) security_hole(port:0, extra:rpm_report_get());
      else security_hole(0);
      exit(0);
    }
    else
    {
      tested = pkg_tests_get();
      if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
      else audit(AUDIT_PACKAGE_NOT_INSTALLED, "perl-Mail-SpamAssassin / perl-Mail-SpamAssassin-Plugin-iXhash2 / etc");
    }
    
  • NASL familyFedora Local Security Checks
    NASL idFEDORA_2020-24DAC7D890.NASL
    descriptionUpdate to 3.4.4. Fixes CVE-2020-1930 and CVE-2020-1931. Note that Tenable Network Security has extracted the preceding description block directly from the Fedora update system website. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.
    last seen2020-06-01
    modified2020-06-02
    plugin id133626
    published2020-02-12
    reporterThis script is Copyright (C) 2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/133626
    titleFedora 31 : spamassassin (2020-24dac7d890)
  • NASL familyDebian Local Security Checks
    NASL idDEBIAN_DSA-4615.NASL
    descriptionTwo vulnerabilities were discovered in spamassassin, a Perl-based spam filter using text analysis. Malicious rule or configuration files, possibly downloaded from an updates server, could execute arbitrary commands under multiple scenarios.
    last seen2020-06-01
    modified2020-06-02
    plugin id133418
    published2020-02-03
    reporterThis script is Copyright (C) 2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/133418
    titleDebian DSA-4615-1 : spamassassin - security update
  • NASL familyFreeBSD Local Security Checks
    NASL idFREEBSD_PKG_E3404A6E436411EAB643206A8A720317.NASL
    descriptionthe Apache Spamassassin project reports : nefarious rule configuration (.cf) files can be configured to run system commands similar to CVE-2018-11805. This issue is less stealthy and attempts to exploit the issue will throw warnings.
    last seen2020-06-01
    modified2020-06-02
    plugin id133380
    published2020-01-31
    reporterThis script is Copyright (C) 2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/133380
    titleFreeBSD : spamassassin -- Apache SpamAssassin Nefarious rule configuration (.cf) files can be configured to run system commands with warnings (e3404a6e-4364-11ea-b643-206a8a720317)
  • NASL familyFreeBSD Local Security Checks
    NASL idFREEBSD_PKG_C86BFEE3444111EA8BE354E1AD3D6335.NASL
    descriptionThe Apache SpamAssassin project reports : A nefarious rule configuration (.cf) files can be configured to run system commands. This issue is less stealthy and attempts to exploit the issue will throw warnings. Thanks to Damian Lukowski at credativ for reporting the issue ethically. With this bug unpatched, exploits can be injected in a number of scenarios though doing so remotely is difficult. In addition to upgrading to SA 3.4.4, we again recommend that users should only use update channels or 3rd party .cf files from trusted places.
    last seen2020-06-01
    modified2020-06-02
    plugin id133435
    published2020-02-03
    reporterThis script is Copyright (C) 2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/133435
    titleFreeBSD : spamassassin -- Nefarious rule configuration files can run system commands (c86bfee3-4441-11ea-8be3-54e1ad3d6335)
  • NASL familyFedora Local Security Checks
    NASL idFEDORA_2020-BD20036CDC.NASL
    descriptionUpdate to 3.4.4. Fixes CVE-2020-1930 and CVE-2020-1931. Note that Tenable Network Security has extracted the preceding description block directly from the Fedora update system website. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.
    last seen2020-06-01
    modified2020-06-02
    plugin id133628
    published2020-02-12
    reporterThis script is Copyright (C) 2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/133628
    titleFedora 30 : spamassassin (2020-bd20036cdc)
  • NASL familySuSE Local Security Checks
    NASL idSUSE_SU-2020-0811-1.NASL
    descriptionThis update for spamassassin fixes the following issues : Security issues fixed : CVE-2018-11805: Fixed an issue with delimiter handling in rule files related to is_regexp_valid() (bsc#1118987). CVE-2020-1930: Fixed an issue with rule configuration (.cf) files which can be configured to run system commands (bsc#1162197). CVE-2020-1931: Fixed an issue with rule configuration (.cf) files which can be configured to run system commands with warnings (bsc#1162200). Non-security issue fixed: Altering hash requires restarting loop (bsc#862963). Note that Tenable Network Security has extracted the preceding description block directly from the SUSE security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.
    last seen2020-04-04
    modified2020-03-31
    plugin id135024
    published2020-03-31
    reporterThis script is Copyright (C) 2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/135024
    titleSUSE SLED15 / SLES15 Security Update : spamassassin (SUSE-SU-2020:0811-1)
  • NASL familyDebian Local Security Checks
    NASL idDEBIAN_DLA-2107.NASL
    descriptionTwo vulnerabilities were discovered in spamassassin, a Perl-based spam filter using text analysis. Malicious rule or configuration files, possibly downloaded from an updates server, could execute arbitrary commands under multiple scenarios. For Debian 8
    last seen2020-03-17
    modified2020-02-19
    plugin id133772
    published2020-02-19
    reporterThis script is Copyright (C) 2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/133772
    titleDebian DLA-2107-1 : spamassassin security update
  • NASL familyUbuntu Local Security Checks
    NASL idUBUNTU_USN-4265-1.NASL
    descriptionIt was discovered that SpamAssassin incorrectly handled certain CF files. If a user or automated system were tricked into using a specially crafted CF file, a remote attacker could possibly run arbitrary code. Note that Tenable Network Security has extracted the preceding description block directly from the Ubuntu security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.
    last seen2020-06-01
    modified2020-06-02
    plugin id133496
    published2020-02-05
    reporterUbuntu Security Notice (C) 2020 Canonical, Inc. / NASL script (C) 2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/133496
    titleUbuntu 16.04 LTS / 18.04 LTS / 19.10 : spamassassin vulnerabilities (USN-4265-1)
  • NASL familySuSE Local Security Checks
    NASL idSUSE_SU-2020-0813-1.NASL
    descriptionThis update for spamassassin fixes the following issues : Security issues fixed : CVE-2018-11805: Fixed an issue with delimiter handling in rule files related to is_regexp_valid() (bsc#1118987). CVE-2020-1930: Fixed an issue with rule configuration (.cf) files which can be configured to run system commands (bsc#1162197). CVE-2020-1931: Fixed an issue with rule configuration (.cf) files which can be configured to run system commands with warnings (bsc#1162200). Non-security issue fixed: Altering hash requires restarting loop (bsc#862963). Note that Tenable Network Security has extracted the preceding description block directly from the SUSE security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.
    last seen2020-04-04
    modified2020-03-31
    plugin id135025
    published2020-03-31
    reporterThis script is Copyright (C) 2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/135025
    titleSUSE SLES15 Security Update : spamassassin (SUSE-SU-2020:0813-1)
  • NASL familySuSE Local Security Checks
    NASL idSUSE_SU-2020-0810-1.NASL
    descriptionThis update for spamassassin fixes the following issues : CVE-2018-11805: Fixed an issue with delimiter handling in rule files related to is_regexp_valid() (bsc#1118987). CVE-2020-1930: Fixed an issue with rule configuration (.cf) files which can be configured to run system commands (bsc#1162197). CVE-2020-1931: Fixed an issue with rule configuration (.cf) files which can be configured to run system commands with warnings (bsc#1162200). Note that Tenable Network Security has extracted the preceding description block directly from the SUSE security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.
    last seen2020-04-04
    modified2020-03-31
    plugin id135023
    published2020-03-31
    reporterThis script is Copyright (C) 2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/135023
    titleSUSE SLES12 Security Update : spamassassin (SUSE-SU-2020:0810-1)