CVE-2020-35681: Channels Django Channels Leakage Of Session Vulnerability

HIGH
Advisory Identifier: GHSA-v542-8q9x-cffc
CVSS 7.4
CWE-200
Published
Advisory Summary

CVE-2020-35681 is a HIGH (CVSS 7.4) django channels leakage of session vulnerability (CWE-200: Exposure of Sensitive Information to an Unauthorized Actor) affecting Channels libraries in the PyPI ecosystem. The issue involves django channels leakage of session identifiers using legacy asgihandler. Remediation is available by upgrading affected packages to version 3.0.3.

CVE-2020-35681 at a Glance

CVE Identifier CVE-2020-35681
GHSA Identifier GHSA-v542-8q9x-cffc
Severity HIGH
CVSS v3.1 Base Score 7.4
CWE Classification CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
Affected Product Channels
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.4

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

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 High (C:H)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2020-35681

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

channels fixed: 3.0.3
pip install channels>=3.0.3
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 channels

How to Check if You Are Affected

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

pip show channels

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor, where the product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. In Channels, 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

Django Channels 3.x before 3.0.3 allows remote attackers to obtain sensitive information from a different request scope. The legacy channels.http.AsgiHandler class, used for handling HTTP type requests in an ASGI environment prior to Django 3.0, did not correctly separate request scopes in Channels 3.0. In many cases this would result in a crash but, with correct timing, responses could be sent to the wrong client, resulting in potential leakage of session identifiers and other sensitive data. Note that this affects only the legacy Channels provided class, and not Django's similar ASGIHandler, available from Django 3.0.

CVE-2020-35681 Affected Channels Versions

1 component(s)
Fixed Versions:
3.0.3
Product / Package Ecosystem Affected Versions Fixed Version
channels
PyPI
≥ 3.0.0
< 3.0.3
3.0.3

References

Frequently Asked Questions

What is CVE-2020-35681?
CVE-2020-35681 is a security vulnerability in Channels involving Django Channels leakage of session identifiers using legacy AsgiHandler under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor.
Which Channels versions are affected?
Affected versions include releases prior to 3.0.3 across affected packages: channels.
What version fixes CVE-2020-35681?
Upgrading to 3.0.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is channels affected?
Yes, channels is affected in releases prior to 3.0.3. Upgrade your dependency to 3.0.3 or later.
What is the CVSS score of CVE-2020-35681?
CVE-2020-35681 has a CVSS v3.1 base score of 7.4 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:H.
What CWE is associated with CVE-2020-35681?
CVE-2020-35681 is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor (The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.).
How can I check PyPI dependencies for CVE-2020-35681?
Run the dependency tree command: 'pip show channels'. 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-v542-8q9x-cffc",
  "modified" : "2024-09-13T17:49:26Z",
  "published" : "2021-03-19T21:29:02Z",
  "aliases" : [ "CVE-2020-35681" ],
  "summary" : "Django Channels leakage of session identifiers using legacy AsgiHandler",
  "details" : "Django Channels 3.x before 3.0.3 allows remote attackers to obtain sensitive information from a different request scope. The legacy channels.http.AsgiHandler class, used for handling HTTP type requests in an ASGI environment prior to Django 3.0, did not correctly separate request scopes in Channels 3.0. In many cases this would result in a crash but, with correct timing, responses could be sent to the wrong client, resulting in potential leakage of session identifiers and other sensitive data. Note that this affects only the legacy Channels provided class, and not Django's similar ASGIHandler, available from Django 3.0.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "channels"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "fixed" : "3.0.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-35681"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/django/channels/commit/e85874d9630474986a6937430eac52db79a2a022"
  }, {
    "type" : "WEB",
    "url" : "https://channels.readthedocs.io/en/stable/releases/3.0.3.html"
  }, {
    "type" : "WEB",
    "url" : "https://channels.readthedocs.io/en/stable/releases/index.html"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-v542-8q9x-cffc"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/django/channels"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/django/channels/releases"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/channels/PYSEC-2021-113.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-03-13T00:47:11Z",
    "nvd_published_at" : "2021-02-22T03:15:00Z"
  }
}