CVE-2019-11340: Matrix sydent Matrix Sydent Mishandles Emails Vulnerability

MODERATE
Advisory Identifier: GHSA-q9h8-gpw5-c95c
CVSS 5.9
CWE-20
Published
Advisory Summary

CVE-2019-11340 is a MODERATE (CVSS 5.9) matrix sydent mishandles emails vulnerability (CWE-20: Improper Input Validation) affecting Matrix sydent libraries in the PyPI ecosystem. The issue involves matrix sydent mishandles emails. Remediation is available by upgrading affected packages to version 1.0.2.

CVE-2019-11340 at a Glance

CVE Identifier CVE-2019-11340
GHSA Identifier GHSA-q9h8-gpw5-c95c
Severity MODERATE
CVSS v3.1 Base Score 5.9
CWE Classification CWE-20: Improper Input Validation
Affected Product Matrix sydent
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 5.9

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2019-11340

To remediate this vulnerability, upgrade all affected Matrix sydent dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

matrix-sydent fixed: 1.0.2
pip install matrix-sydent>=1.0.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show matrix-sydent

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2019-11340, inspect your installed packages using pip:

pip show matrix-sydent

Analyze the terminal output to locate any version of Matrix sydent in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0.2), your application is affected.

Note: The pip show matrix-sydent command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Matrix sydent, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

util/emailutils.py in Matrix Sydent before 1.0.2 mishandles registration restrictions that are based on e-mail domain, if the allowed_local_3pids option is enabled. This occurs because of potentially unwanted behavior in Python, in which an email.utils.parseaddr call on user@bad.example.net@good.example.com returns the user@bad.example.net substring.

CVE-2019-11340 Affected Matrix sydent Versions

1 component(s)
Fixed Versions:
1.0.2
Product / Package Ecosystem Affected Versions Fixed Version
matrix-sydent
PyPI
< 1.0.2
1.0.2

References

Frequently Asked Questions

What is CVE-2019-11340?
CVE-2019-11340 is a security vulnerability in Matrix sydent involving Matrix Sydent mishandles emails under CWE-20: Improper Input Validation.
Which Matrix sydent versions are affected?
Affected versions include releases prior to 1.0.2 across affected packages: matrix-sydent.
What version fixes CVE-2019-11340?
Upgrading to 1.0.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is matrix-sydent affected?
Yes, matrix-sydent is affected in releases prior to 1.0.2. Upgrade your dependency to 1.0.2 or later.
What is the CVSS score of CVE-2019-11340?
CVE-2019-11340 has a CVSS v3.1 base score of 5.9 (MODERATE) with vector string CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2019-11340?
CVE-2019-11340 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check PyPI dependencies for CVE-2019-11340?
Run the dependency tree command: 'pip show matrix-sydent'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-q9h8-gpw5-c95c",
  "modified" : "2023-08-01T23:30:01Z",
  "published" : "2022-05-24T16:43:57Z",
  "aliases" : [ "CVE-2019-11340" ],
  "summary" : "Matrix Sydent mishandles emails",
  "details" : "util/emailutils.py in Matrix Sydent before 1.0.2 mishandles registration restrictions that are based on e-mail domain, if the allowed_local_3pids option is enabled. This occurs because of potentially unwanted behavior in Python, in which an email.utils.parseaddr call on user@bad.example.net@good.example.com returns the user@bad.example.net substring.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "matrix-sydent"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.0.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-11340"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/matrix-org/sydent/commit/4e1cfff53429c49c87d5c457a18ed435520044fc"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/matrix-org/sydent/compare/7c002cd...09278fb"
  }, {
    "type" : "WEB",
    "url" : "https://matrix.org/blog/2019/04/18/security-update-sydent-1-0-2"
  }, {
    "type" : "WEB",
    "url" : "https://twitter.com/matrixdotorg/status/1118934335963500545"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-08-01T23:30:01Z",
    "nvd_published_at" : "2019-04-19T14:29:00Z"
  }
}