Vulnerabilities > CVE-2019-12855 - Improper Certificate Validation vulnerability in Twistedmatrix Twisted
Attack vector
NETWORK Attack complexity
HIGH Privileges required
NONE Confidentiality impact
HIGH Integrity impact
HIGH Availability impact
NONE Summary
In words.protocols.jabber.xmlstream in Twisted through 19.2.1, XMPP support did not verify certificates when used with TLS, allowing an attacker to MITM connections.
Vulnerable Configurations
Common Weakness Enumeration (CWE)
Common Attack Pattern Enumeration and Classification (CAPEC)
- Creating a Rogue Certificate Authority Certificate An attacker exploits a weakness in the MD5 hash algorithm (weak collision resistance) to generate a certificate signing request (CSR) that contains collision blocks in the "to be signed" part. The attacker specially crafts two different, but valid X.509 certificates that when hashed with the MD5 algorithm would yield the same value. The attacker then sends the CSR for one of the certificates to the Certification Authority which uses the MD5 hashing algorithm. That request is completely valid and the Certificate Authority issues an X.509 certificate to the attacker which is signed with its private key. An attacker then takes that signed blob and inserts it into another X.509 certificate that the attacker generated. Due to the MD5 collision, both certificates, though different, hash to the same value and so the signed blob works just as well in the second certificate. The net effect is that the attackers' second X.509 certificate, which the Certification Authority has never seen, is now signed and validated by that Certification Authority. To make the attack more interesting, the second certificate could be not just a regular certificate, but rather itself a signing certificate. Thus the attacker is able to start their own Certification Authority that is anchored in its root of trust in the legitimate Certification Authority that has signed the attackers' first X.509 certificate. If the original Certificate Authority was accepted by default by browsers, so will now the Certificate Authority set up by the attacker and of course any certificates that it signs. So the attacker is now able to generate any SSL certificates to impersonate any web server, and the user's browser will not issue any warning to the victim. This can be used to compromise HTTPS communications and other types of systems where PKI and X.509 certificates may be used (e.g., VPN, IPSec) .
Nessus
NASL family SuSE Local Security Checks NASL id SUSE_SU-2019-2212-1.NASL description This update for python-Twisted fixes the following issues : Security issue fixed : CVE-2019-12855: Fixed TLS certificate verification to protecting against MITM attacks (bsc#1138461). 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 seen 2020-06-01 modified 2020-06-02 plugin id 128145 published 2019-08-26 reporter This script is Copyright (C) 2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/128145 title SUSE SLED15 / SLES15 Security Update : python-Twisted (SUSE-SU-2019:2212-1) code # # (C) Tenable Network Security, Inc. # # The descriptive text and package checks in this plugin were # extracted from SUSE update advisory SUSE-SU-2019:2212-1. # The text itself is copyright (C) SUSE. # include("compat.inc"); if (description) { script_id(128145); script_version("1.3"); script_cvs_date("Date: 2019/12/31"); script_cve_id("CVE-2019-12855"); script_name(english:"SUSE SLED15 / SLES15 Security Update : python-Twisted (SUSE-SU-2019:2212-1)"); script_summary(english:"Checks rpm output for the updated packages."); script_set_attribute( attribute:"synopsis", value:"The remote SUSE host is missing one or more security updates." ); script_set_attribute( attribute:"description", value: "This update for python-Twisted fixes the following issues : Security issue fixed : CVE-2019-12855: Fixed TLS certificate verification to protecting against MITM attacks (bsc#1138461). 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." ); script_set_attribute( attribute:"see_also", value:"https://bugzilla.suse.com/show_bug.cgi?id=1138461" ); script_set_attribute( attribute:"see_also", value:"https://www.suse.com/security/cve/CVE-2019-12855/" ); # https://www.suse.com/support/update/announcement/2019/suse-su-20192212-1/ script_set_attribute( attribute:"see_also", value:"http://www.nessus.org/u?750fc62c" ); script_set_attribute( attribute:"solution", value: "To install this SUSE Security Update use the SUSE recommended installation methods like YaST online_update or 'zypper patch'. Alternatively you can run the command listed for your product : SUSE Linux Enterprise Module for Open Buildservice Development Tools 15-SP1:zypper in -t patch SUSE-SLE-Module-Development-Tools-OBS-15-SP1-2019-2212=1 SUSE Linux Enterprise Module for Open Buildservice Development Tools 15:zypper in -t patch SUSE-SLE-Module-Development-Tools-OBS-15-2019-2212=1" ); script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:N/C:P/I:P/A:N"); 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:N"); 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:suse_linux:python-Twisted-debuginfo"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:suse_linux:python-Twisted-debugsource"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:suse_linux:python-Twisted-doc"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:suse_linux:python2-Twisted"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:suse_linux:python2-Twisted-debuginfo"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:suse_linux:python3-Twisted"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:suse_linux:python3-Twisted-debuginfo"); script_set_attribute(attribute:"cpe", value:"cpe:/o:novell:suse_linux:15"); script_set_attribute(attribute:"vuln_publication_date", value:"2019/06/16"); script_set_attribute(attribute:"patch_publication_date", value:"2019/08/23"); script_set_attribute(attribute:"plugin_publication_date", value:"2019/08/26"); script_set_attribute(attribute:"generated_plugin", value:"current"); script_end_attributes(); script_category(ACT_GATHER_INFO); script_copyright(english:"This script is Copyright (C) 2019 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/cpu", "Host/SuSE/release", "Host/SuSE/rpm-list"); 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, "SUSE"); os_ver = pregmatch(pattern: "^(SLE(S|D)\d+)", string:release); if (isnull(os_ver)) audit(AUDIT_UNKNOWN_APP_VER, "SUSE"); os_ver = os_ver[1]; if (! preg(pattern:"^(SLED15|SLES15)$", string:os_ver)) audit(AUDIT_OS_NOT, "SUSE SLED15 / SLES15", "SUSE " + os_ver); if (!get_kb_item("Host/SuSE/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING); cpu = get_kb_item("Host/cpu"); if (isnull(cpu)) audit(AUDIT_UNKNOWN_ARCH); if (cpu !~ "^i[3-6]86$" && "x86_64" >!< cpu && "s390x" >!< cpu) audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, "SUSE " + os_ver, cpu); sp = get_kb_item("Host/SuSE/patchlevel"); if (isnull(sp)) sp = "0"; if (os_ver == "SLES15" && (! preg(pattern:"^(0|1)$", string:sp))) audit(AUDIT_OS_NOT, "SLES15 SP0/1", os_ver + " SP" + sp); if (os_ver == "SLED15" && (! preg(pattern:"^(0|1)$", string:sp))) audit(AUDIT_OS_NOT, "SLED15 SP0/1", os_ver + " SP" + sp); flag = 0; if (rpm_check(release:"SLES15", sp:"1", reference:"python-Twisted-debuginfo-17.9.0-3.6.1")) flag++; if (rpm_check(release:"SLES15", sp:"1", reference:"python-Twisted-debugsource-17.9.0-3.6.1")) flag++; if (rpm_check(release:"SLES15", sp:"1", reference:"python-Twisted-doc-17.9.0-3.6.1")) flag++; if (rpm_check(release:"SLES15", sp:"1", reference:"python2-Twisted-17.9.0-3.6.1")) flag++; if (rpm_check(release:"SLES15", sp:"1", reference:"python2-Twisted-debuginfo-17.9.0-3.6.1")) flag++; if (rpm_check(release:"SLES15", sp:"1", reference:"python3-Twisted-17.9.0-3.6.1")) flag++; if (rpm_check(release:"SLES15", sp:"1", reference:"python3-Twisted-debuginfo-17.9.0-3.6.1")) flag++; if (rpm_check(release:"SLES15", sp:"0", reference:"python-Twisted-debuginfo-17.9.0-3.6.1")) flag++; if (rpm_check(release:"SLES15", sp:"0", reference:"python-Twisted-debugsource-17.9.0-3.6.1")) flag++; if (rpm_check(release:"SLES15", sp:"0", reference:"python-Twisted-doc-17.9.0-3.6.1")) flag++; if (rpm_check(release:"SLES15", sp:"0", reference:"python2-Twisted-17.9.0-3.6.1")) flag++; if (rpm_check(release:"SLES15", sp:"0", reference:"python2-Twisted-debuginfo-17.9.0-3.6.1")) flag++; if (rpm_check(release:"SLES15", sp:"0", reference:"python3-Twisted-17.9.0-3.6.1")) flag++; if (rpm_check(release:"SLES15", sp:"0", reference:"python3-Twisted-debuginfo-17.9.0-3.6.1")) flag++; if (rpm_check(release:"SLED15", sp:"1", reference:"python-Twisted-debuginfo-17.9.0-3.6.1")) flag++; if (rpm_check(release:"SLED15", sp:"1", reference:"python-Twisted-debugsource-17.9.0-3.6.1")) flag++; if (rpm_check(release:"SLED15", sp:"1", reference:"python-Twisted-doc-17.9.0-3.6.1")) flag++; if (rpm_check(release:"SLED15", sp:"1", reference:"python2-Twisted-17.9.0-3.6.1")) flag++; if (rpm_check(release:"SLED15", sp:"1", reference:"python2-Twisted-debuginfo-17.9.0-3.6.1")) flag++; if (rpm_check(release:"SLED15", sp:"1", reference:"python3-Twisted-17.9.0-3.6.1")) flag++; if (rpm_check(release:"SLED15", sp:"1", reference:"python3-Twisted-debuginfo-17.9.0-3.6.1")) flag++; if (rpm_check(release:"SLED15", sp:"0", reference:"python-Twisted-debuginfo-17.9.0-3.6.1")) flag++; if (rpm_check(release:"SLED15", sp:"0", reference:"python-Twisted-debugsource-17.9.0-3.6.1")) flag++; if (rpm_check(release:"SLED15", sp:"0", reference:"python-Twisted-doc-17.9.0-3.6.1")) flag++; if (rpm_check(release:"SLED15", sp:"0", reference:"python2-Twisted-17.9.0-3.6.1")) flag++; if (rpm_check(release:"SLED15", sp:"0", reference:"python2-Twisted-debuginfo-17.9.0-3.6.1")) flag++; if (rpm_check(release:"SLED15", sp:"0", reference:"python3-Twisted-17.9.0-3.6.1")) flag++; if (rpm_check(release:"SLED15", sp:"0", reference:"python3-Twisted-debuginfo-17.9.0-3.6.1")) flag++; if (flag) { if (report_verbosity > 0) security_warning(port:0, extra:rpm_report_get()); else security_warning(0); exit(0); } else { tested = pkg_tests_get(); if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested); else audit(AUDIT_PACKAGE_NOT_INSTALLED, "python-Twisted"); }
NASL family Fedora Local Security Checks NASL id FEDORA_2019-D480909528.NASL description Security fix for CVE-2019-12855. 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 seen 2020-06-01 modified 2020-06-02 plugin id 127875 published 2019-08-14 reporter This script is Copyright (C) 2019-2020 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/127875 title Fedora 30 : python-twisted (2019-d480909528) code # # (C) Tenable Network Security, Inc. # # The descriptive text and package checks in this plugin were # extracted from Fedora Security Advisory FEDORA-2019-d480909528. # include("compat.inc"); if (description) { script_id(127875); script_version("1.3"); script_cvs_date("Date: 2020/01/02"); script_cve_id("CVE-2019-12855"); script_xref(name:"FEDORA", value:"2019-d480909528"); script_name(english:"Fedora 30 : python-twisted (2019-d480909528)"); script_summary(english:"Checks rpm output for the updated package."); script_set_attribute( attribute:"synopsis", value:"The remote Fedora host is missing a security update." ); script_set_attribute( attribute:"description", value: "Security fix for CVE-2019-12855. 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." ); script_set_attribute( attribute:"see_also", value:"https://bodhi.fedoraproject.org/updates/FEDORA-2019-d480909528" ); script_set_attribute( attribute:"solution", value:"Update the affected python-twisted package." ); script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:N/C:P/I:P/A:N"); 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:N"); 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:fedoraproject:fedora:python-twisted"); script_set_attribute(attribute:"cpe", value:"cpe:/o:fedoraproject:fedora:30"); script_set_attribute(attribute:"vuln_publication_date", value:"2019/06/16"); script_set_attribute(attribute:"patch_publication_date", value:"2019/08/14"); script_set_attribute(attribute:"plugin_publication_date", value:"2019/08/14"); script_set_attribute(attribute:"generated_plugin", value:"current"); script_end_attributes(); script_category(ACT_GATHER_INFO); script_copyright(english:"This script is Copyright (C) 2019-2020 and is owned by Tenable, Inc. or an Affiliate thereof."); script_family(english:"Fedora Local Security Checks"); script_dependencies("ssh_get_info.nasl"); script_require_keys("Host/local_checks_enabled", "Host/RedHat/release", "Host/RedHat/rpm-list"); 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/RedHat/release"); if (isnull(release) || "Fedora" >!< release) audit(AUDIT_OS_NOT, "Fedora"); os_ver = pregmatch(pattern: "Fedora.*release ([0-9]+)", string:release); if (isnull(os_ver)) audit(AUDIT_UNKNOWN_APP_VER, "Fedora"); os_ver = os_ver[1]; if (! preg(pattern:"^30([^0-9]|$)", string:os_ver)) audit(AUDIT_OS_NOT, "Fedora 30", "Fedora " + os_ver); if (!get_kb_item("Host/RedHat/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING); cpu = get_kb_item("Host/cpu"); if (isnull(cpu)) audit(AUDIT_UNKNOWN_ARCH); if ("x86_64" >!< cpu && cpu !~ "^i[3-6]86$") audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, "Fedora", cpu); flag = 0; if (rpm_check(release:"FC30", reference:"python-twisted-19.2.1-3.fc30")) flag++; if (flag) { security_report_v4( port : 0, severity : SECURITY_WARNING, extra : rpm_report_get() ); exit(0); } else { tested = pkg_tests_get(); if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested); else audit(AUDIT_PACKAGE_NOT_INSTALLED, "python-twisted"); }
NASL family SuSE Local Security Checks NASL id SUSE_SU-2019-2453-1.NASL description This update for python-Twisted fixes the following issues : Security issue fixed : CVE-2019-12855: Fixed TLS certificate verification to protecting against MITM attacks (bsc#1138461). 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 seen 2020-06-01 modified 2020-06-02 plugin id 129349 published 2019-09-25 reporter This script is Copyright (C) 2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/129349 title SUSE SLES12 Security Update : python-Twisted (SUSE-SU-2019:2453-1) NASL family Ubuntu Local Security Checks NASL id UBUNTU_USN-4308-1.NASL description it was discovered that Twisted incorrectly validated or sanitized certain URIs or HTTP methods. A remote attacker could use this issue to inject invalid characters and possibly perform header injection attacks. (CVE-2019-12387) It was discovered that Twisted incorrectly verified XMPP TLS certificates. A remote attacker could possibly use this issue to perform a man-in-the-middle attack and obtain sensitive information. (CVE-2019-12855) It was discovered that Twisted incorrectly handled HTTP/2 connections. A remote attacker could possibly use this issue to cause Twisted to hang or consume resources, leading to a denial of service. This issue only affected Ubuntu 18.04 LTS and Ubuntu 19.10. (CVE-2019-9512, CVE-2019-9514, CVE-2019-9515) Jake Miller and ZeddYu Lu discovered that Twisted incorrectly handled certain content-length headers. A remote attacker could possibly use this issue to perform HTTP request splitting attacks. (CVE-2020-10108, CVE-2020-10109). 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 seen 2020-03-26 modified 2020-03-20 plugin id 134758 published 2020-03-20 reporter Ubuntu Security Notice (C) 2020 Canonical, Inc. / NASL script (C) 2020 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/134758 title Ubuntu 16.04 LTS / 18.04 LTS / 19.10 : twisted vulnerabilities (USN-4308-1) (Ping Flood) (Reset Flood) (Settings Flood) NASL family SuSE Local Security Checks NASL id OPENSUSE-2019-2068.NASL description This update for python-Twisted fixes the following issues : Security issue fixed : - CVE-2019-12855: Fixed TLS certificate verification to protecting against MITM attacks (bsc#1138461). This update was imported from the SUSE:SLE-15:Update update project. last seen 2020-06-01 modified 2020-06-02 plugin id 128538 published 2019-09-06 reporter This script is Copyright (C) 2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/128538 title openSUSE Security Update : python-Twisted (openSUSE-2019-2068)
References
- https://twistedmatrix.com/trac/ticket/9561
- https://github.com/twisted/twisted/pull/1147
- http://lists.opensuse.org/opensuse-security-announce/2019-09/msg00013.html
- http://lists.opensuse.org/opensuse-security-announce/2019-09/msg00028.html
- https://usn.ubuntu.com/4308-1/
- https://usn.ubuntu.com/4308-2/
- https://www.oracle.com/security-alerts/cpuapr2020.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/PLTZDMFBNFSJMBXYJNGJHENJA4H2TSMZ/