Skip to content
Heist/ feed
Back to feed
Medium

Security advisory

Type: advisorySources: OSVCVE: CVE-2020-5252

The command-line "safety" package for Python has a potential security issue. There are two Python characteristics that allow malicious code to “poison-pill” command-line Safety package detection routines by disguising, or obfuscating, other malicious or non-secure packages. This vulnerability is considered to be of low severity because the attack makes use of an existing Python condition, not the Safety tool itself. This can happen if: You are running Safety in a Python environment that you don’t trust. You are running Safety from the same Python environment where you have your dependencies installed. Dependency packages are being installed arbitrarily or without proper verification. Users can mitigate this issue by doing any of the following: Perform a static analysis by installing Docker and running the Safety Docker image: $ docker run --rm -it pyupio/safety check -r requirements.txt Run Safety against a static dependencies list, such as the requirements.txt file, in a separate, clean Python environment. Run Safety from a Continuous Integration pipeline. Use PyUp.io, which runs Safety in a controlled environment and checks Python for dependencies without any need to install them. Use PyUp's Online Requirements Checker.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2020-5252
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 11:29 UTC · Revision 1

Source evidence

CVE-2020-5252

core-osv · Original source

Published 23 Mar 2020, 23:15 UTC

The command-line "safety" package for Python has a potential security issue. There are two Python characteristics that allow malicious code to “poison-pill” command-line Safety package detection routines by disguising, or obfuscating, other malicious or non-secure packages. This vulnerability is considered to be of low severity because the attack makes use of an existing Python condition, not the Safety tool itself. This can happen if: You are running Safety in a Python environment that you don’t trust. You are running Safety from the same Python environment where you have your dependencies installed. Dependency packages are being installed arbitrarily or without proper verification. Users can mitigate this issue by doing any of the following: Perform a static analysis by installing Docker and running the Safety Docker image: $ docker run --rm -it pyupio/safety check -r requirements.txt Run Safety against a static dependencies list, such as the requirements.txt file, in a separate, clean Python environment. Run Safety from a Continuous Integration pipeline. Use PyUp.io, which runs Safety in a controlled environment and checks Python for dependencies without any need to install them. Use PyUp's Online Requirements Checker.

osv:CVE-2020-5252
Complete source record
{
  "id": "2ec8d7e7e438a75e5ac1d9f24645e10efd23881c3a66ce2339e9632038aa8b60",
  "url": "https://osv.dev/vulnerability/CVE-2020-5252",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2020-5252",
    "summary": "The command-line \"safety\" package for Python has a potential security issue. There are two Python characteristics that allow malicious code to “poison-pill” command-line Safety package detection routines by disguising, or obfuscating, other malicious or non-secure packages. This vulnerability is considered to be of low severity because the attack makes use of an existing Python condition, not the Safety tool itself. This can happen if: You are running Safety in a Python environment that you don’t trust. You are running Safety from the same Python environment where you have your dependencies installed. Dependency packages are being installed arbitrarily or without proper verification. Users can mitigate this issue by doing any of the following: Perform a static analysis by installing Docker and running the Safety Docker image: $ docker run --rm -it pyupio/safety check -r requirements.txt Run Safety against a static dependencies list, such as the requirements.txt file, in a separate, clean Python environment. Run Safety from a Continuous Integration pipeline. Use PyUp.io, which runs Safety in a controlled environment and checks Python for dependencies without any need to install them. Use PyUp's Online Requirements Checker.",
    "evidence": "osv:CVE-2020-5252",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2020-5252",
      "aliases": [
        "CVE-2020-5252",
        "GHSA-7q25-qrjw-6fg2",
        "PYSEC-2020-101"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:H/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/pyupio/safety",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "last_affected": "66745dbc8920acab58be492089697ec39a8bc02e"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:pyup:safety:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "last_affected": "1.8.6"
                      }
                    ],
                    "source": "CPE_RANGE"
                  }
                ]
              }
            }
          ],
          "versions": [
            "1.8.6",
            "1.8.5",
            "1.8.4",
            "1.8.3b",
            "1.8.3-release",
            "1.8.3-re",
            "1.8.3",
            "1.8.2-re",
            "1.8.2",
            "1.8.1",
            "1.8.0",
            "1.7.0",
            "1.6.1",
            "1.6.0",
            "1.5.1",
            "1.5.0",
            "1.4.1",
            "1.4.0",
            "1.3.0",
            "1.2.0",
            "1.1.1",
            "1.1.0",
            "1.0.2",
            "1.0.1",
            "1.0",
            "0.6.0",
            "0.5.1",
            "0.5.0",
            "0.4.0",
            "0.3.0",
            "0.2.1",
            "0.2.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2020-5252.json"
          }
        }
      ],
      "modified": "2026-10-20T10:54:23.364677838Z",
      "provider": "osv",
      "references": [
        "https://github.com/pyupio/safety/security/advisories/GHSA-7q25-qrjw-6fg2",
        "https://pyup.io/posts/patched-vulnerability/",
        "https://github.com/akoumjian/python-safety-vuln"
      ],
      "provider_metadata": {}
    },
    "related_cves": [
      {
        "value": "CVE-2020-5252",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 385265,
  "published_at": "2020-03-23T23:15:12.75+00:00"
}