原始 OSV JSON
{
"id": "GHSA-7q25-qrjw-6fg2",
"aliases": [
"CVE-2020-5252"
],
"details": "# Python Auditing Vulnerability\n\nDemonstrates how a malicious package can insert a load-time poison pill to avoid detection by tools like Safety.\n\nTools that are designed to find vulnerable packages can not ever run in the same python environment that they are trying to protect.\n\n## Usage\n\nInstall `safety`, `insecure-package`, and this package with pip in the same python environment. Order doesn't matter.\n\n1. pip install safety\n2. pip install insecure-package\n3. pip install dist/malicious-0.1-py3-none-any.whl\n\nRun the check\n\n4. `safety check`\n\nYou should see both `Running my modified safety.check` and that `insecure-package` is not listed in the results!\n\n\n## How it Works\n\nEverything in Python is mutable. The trick is getting some code to run at interpreter load time in order to do some patching.\n\n1. When you install this package, the `setup.py` settings installs a `malicious.pth` file to your `site-packages` directory.\n2. The `malicious.pth` file gets loaded anytime Python starts, which in turn imports our `malicious` package.\n3. The `malicious/__init__.py` patches the safety library with a custom function to avoid detection.",
"summary": "Malicious package may avoid detection in python auditing",
"affected": [
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "1.9.0"
}
]
}
],
"package": {
"name": "safety",
"ecosystem": "PyPI"
}
}
],
"modified": "2024-10-21T21:06:25Z",
"severity": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:C/C:N/I:H/A:N"
}
],
"published": "2020-03-24T15:07:56Z",
"references": [
{
"url": "https://github.com/pyupio/safety/security/advisories/GHSA-7q25-qrjw-6fg2",
"type": "WEB"
},
{
"url": "https://nvd.nist.gov/vuln/detail/CVE-2020-5252",
"type": "ADVISORY"
},
{
"url": "https://github.com/akoumjian/python-safety-vuln",
"type": "WEB"
},
{
"url": "https://github.com/pypa/advisory-database/tree/main/vulns/safety/PYSEC-2020-101.yaml",
"type": "WEB"
},
{
"url": "https://github.com/pyupio/safety",
"type": "PACKAGE"
},
{
"url": "https://mulch.dev/blog/CVE-2020-5252-python-safety-vuln",
"type": "WEB"
},
{
"url": "https://pyup.io/posts/patched-vulnerability",
"type": "WEB"
}
],
"schema_version": "1.4.0",
"database_specific": {
"cwe_ids": [
"CWE-807"
],
"severity": "MODERATE",
"github_reviewed": true,
"nvd_published_at": null,
"github_reviewed_at": "2020-03-23T23:07:41Z"
}
}