Vulnerabilities in pkg:pypi/tortoise-orm

PACKAGE
Advisory Identifier: GHSA-9j2c-x8qm-qmjq
Advisory Summary

CVE-2020-11010 is a MODERATE (CVSS 6.3) sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Tortoise orm libraries in the PyPI ecosystem. The issue involves sql injection in tortoise orm. Remediation is available by upgrading affected packages to version 0.15.23, 0.16.6.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/tortoise-orm

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/tortoise-orm. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-9j2c-x8qm-qmjq CVE-2020-11010 MODERATE SQL injection in Tortoise ORM

CVE-2020-11010 at a Glance

CVE Identifier CVE-2020-11010
GHSA Identifier GHSA-9j2c-x8qm-qmjq
Severity MODERATE
CVSS v3.1 Base Score 6.3
CWE Classification CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Product Tortoise orm
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 6.3

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

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

How to Fix CVE-2020-11010

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

tortoise-orm fixed: 0.15.23
pip install tortoise-orm>=0.15.23
tortoise-orm fixed: 0.16.6
pip install tortoise-orm>=0.16.6
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 tortoise-orm

How to Check if You Are Affected

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

pip show tortoise-orm

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In Tortoise orm, 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

### Impact Various forms of SQL injection has been found, for MySQL and when filtering or doing mass-updates on char/text fields. SQLite & PostgreSQL was only affected when filtering with ``contains``, ``starts_with`` or ``ends_with`` filters (and their case-insensitive counterparts) ### Patches Please upgrade to 0.15.23+ or 0.16.6+ ### For more information If you have any questions or comments about this advisory: * Open an issue in [Github](https://github.com/tortoise/tortoise-orm/issues) * Chat to us on [Gitter](https://gitter.im/tortoise/community)

CVE-2020-11010 Affected Tortoise orm Versions

2 component(s)
Fixed Versions:
0.15.230.16.6
Product / Package Ecosystem Affected Versions Fixed Version
tortoise-orm
PyPI
< 0.15.23
0.15.23
tortoise-orm
PyPI
≥ 0.16.0
< 0.16.6
0.16.6

References

Frequently Asked Questions

What is CVE-2020-11010?
CVE-2020-11010 is a security vulnerability in Tortoise orm involving SQL injection in Tortoise ORM under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which Tortoise orm versions are affected?
Affected versions include releases prior to 0.15.23, 0.16.6 across affected packages: tortoise-orm.
What version fixes CVE-2020-11010?
Upgrading to 0.15.23, 0.16.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is tortoise-orm affected?
Yes, tortoise-orm is affected in releases prior to 0.15.23, 0.16.6. Upgrade your dependency to 0.15.23, 0.16.6 or later.
What is the CVSS score of CVE-2020-11010?
CVE-2020-11010 has a CVSS v3.1 base score of 6.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L.
What CWE is associated with CVE-2020-11010?
CVE-2020-11010 is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') (The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.).
How can I check PyPI dependencies for CVE-2020-11010?
Run the dependency tree command: 'pip show tortoise-orm'. 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-9j2c-x8qm-qmjq",
  "modified" : "2024-11-13T22:53:29Z",
  "published" : "2020-04-20T21:31:23Z",
  "aliases" : [ "CVE-2020-11010" ],
  "summary" : "SQL injection in Tortoise ORM",
  "details" : "### Impact\nVarious forms of SQL injection has been found, for MySQL and when filtering or doing mass-updates on char/text fields.\nSQLite & PostgreSQL was only affected when filtering with ``contains``, ``starts_with`` or ``ends_with`` filters (and their case-insensitive counterparts)\n\n\n### Patches\nPlease upgrade to 0.15.23+ or 0.16.6+\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [Github](https://github.com/tortoise/tortoise-orm/issues)\n* Chat to us on [Gitter](https://gitter.im/tortoise/community)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "tortoise-orm"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.15.23"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "tortoise-orm"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.16.0"
      }, {
        "fixed" : "0.16.6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/tortoise/tortoise-orm/security/advisories/GHSA-9j2c-x8qm-qmjq"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-11010"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/tortoise/tortoise-orm/commit/91c364053e0ddf77edc5442914c6f049512678b3"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/tortoise-orm/PYSEC-2020-144.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/tortoise/tortoise-orm"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-89" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-04-20T21:31:05Z",
    "nvd_published_at" : null
  }
}