Vulnerabilities in pkg:pypi/pycsw

PACKAGE
Advisory Identifier: GHSA-hg4c-rgvm-964g
Advisory Summary

CVE-2016-8640 is a CRITICAL (CVSS 9.1) sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Pycsw libraries in the PyPI ecosystem. The issue involves sql injection in pycsw. Remediation is available by upgrading affected packages to version 2.0.2, 1.8.6, 1.10.5.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/pycsw

1 Known Advisory Record(s)

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

Advisory ID CVE / NVD Severity Summary
GHSA-hg4c-rgvm-964g CVE-2016-8640 CRITICAL SQL Injection in pycsw

CVE-2016-8640 at a Glance

CVE Identifier CVE-2016-8640
GHSA Identifier GHSA-hg4c-rgvm-964g
Severity CRITICAL
CVSS v3.1 Base Score 9.1
CWE Classification CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Product Pycsw
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 9.1

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

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

How to Fix CVE-2016-8640

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

pycsw fixed: 2.0.2
pip install pycsw>=2.0.2
pycsw fixed: 1.8.6
pip install pycsw>=1.8.6
pycsw fixed: 1.10.5
pip install pycsw>=1.10.5
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 pycsw

How to Check if You Are Affected

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

pip show pycsw

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

Note: The pip show pycsw 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 Pycsw, 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

A SQL injection vulnerability in pycsw all versions before 2.0.2, 1.10.5 and 1.8.6 that leads to read and extract of any data from any table in the pycsw database that the database user has access to. Also on PostgreSQL (at least) it is possible to perform updates/inserts/deletes and database modifications to any table the database user has access to.

CVE-2016-8640 Affected Pycsw Versions

3 component(s)
Fixed Versions:
2.0.21.8.61.10.5
Product / Package Ecosystem Affected Versions Fixed Version
pycsw
PyPI
≥ 2.0.0
< 2.0.2
2.0.2
pycsw
PyPI
< 1.8.6
1.8.6
pycsw
PyPI
≥ 1.10.0
< 1.10.5
1.10.5

References

Frequently Asked Questions

What is CVE-2016-8640?
CVE-2016-8640 is a security vulnerability in Pycsw involving SQL Injection in pycsw under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which Pycsw versions are affected?
Affected versions include releases prior to 2.0.2, 1.8.6, 1.10.5 across affected packages: pycsw.
What version fixes CVE-2016-8640?
Upgrading to 2.0.2, 1.8.6, 1.10.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pycsw affected?
Yes, pycsw is affected in releases prior to 2.0.2, 1.8.6, 1.10.5. Upgrade your dependency to 2.0.2, 1.8.6, 1.10.5 or later.
What is the CVSS score of CVE-2016-8640?
CVE-2016-8640 has a CVSS v3.1 base score of 9.1 (CRITICAL) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2016-8640?
CVE-2016-8640 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-2016-8640?
Run the dependency tree command: 'pip show pycsw'. 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-hg4c-rgvm-964g",
  "modified" : "2026-06-09T13:00:02Z",
  "published" : "2018-08-15T20:02:53Z",
  "aliases" : [ "CVE-2016-8640" ],
  "summary" : "SQL Injection in pycsw",
  "details" : "A SQL injection vulnerability in pycsw all versions before 2.0.2, 1.10.5 and 1.8.6 that leads to read and extract of any data from any table in the pycsw database that the database user has access to. Also on PostgreSQL (at least) it is possible to perform updates/inserts/deletes and database modifications to any table the database user has access to.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pycsw"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.0.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pycsw"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.8.6"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pycsw"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.10.0"
      }, {
        "fixed" : "1.10.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2016-8640"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/geopython/pycsw/pull/474/files"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/geopython/pycsw/commit/522873e5ce48bb9cbd4e7e8168ca881ce709c222"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/geopython/pycsw/commit/69546e13527c82e4f9191769215490381ad511b2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/geopython/pycsw/commit/daaf09b4b920708a415be3c7f446739661ba3753"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-hg4c-rgvm-964g"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/geopython/pycsw"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/pycsw/PYSEC-2018-98.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://patch-diff.githubusercontent.com/raw/geopython/pycsw/pull/474.patch"
  }, {
    "type" : "WEB",
    "url" : "http://seclists.org/oss-sec/2016/q4/406"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-89" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:40:01Z",
    "nvd_published_at" : null
  }
}