{"id":"CVE-2026-56304","aliases":["GHSA-m7j5-r2p5-c39r","PYSEC-2026-225"],"url":"https://o3.security/vulnerability/CVE-2026-56304","summary":"picklescan - Arbitrary File Creation via logging.FileHandler Deserialization","details":"### Summary\nUnsafe pickle deserialization allows unauthenticated attackers to perform Arbitrary File Creation. By chaining the logging.FileHandler class, an attacker can bypass RCE-focused blocklists to create empty files on the server. The vulnerability allows creating zero-byte files in arbitrary locations but does not permit overwriting or modifying existing files.\n\n### Details\nThe application deserializes untrusted pickle data. While RCE keywords may be blocked, the exploit abuses standard library features:\n\nlogging.FileHandler: The exploit instantiates this class using its default behavior (append mode).\n\nBehavior on Existing Files: If the target file already exists, the handler opens it without modifying its content, resulting in no impact to existing data.\n\nBehavior on Non-Existent Files: If the target file does not exist, the handler creates a new zero-byte file with the specified name.\n\n### PoC\n```python\nimport pickle\n\nclass WriteFile:\n    def __reduce__(self):\n        from logging import FileHandler\n        return (FileHandler, ('evil.log',))\n    \nwith open(\"bypass_write.pkl\", \"wb\") as f:\n    pickle.dump(WriteFile(), f)\n\nhandler = pickle.loads(pickle.dumps(WriteFile()))\n```\n<img width=\"1201\" height=\"140\" alt=\"313e1cfacbe700e27b6875e49808c52a\" src=\"https://github.com/user-attachments/assets/8873bb54-0f98-41aa-8e7c-a38a245ca428\" />\n\n\n### Impact\nThis primitive can be used for Filesystem Pollution or Logic Disruption. For example, an attacker could create specific \"lock files\" (e.g., maintenance.lock, .lock) that the application checks for, potentially triggering a Denial of Service (DoS) or preventing the application from starting.","published":"2026-06-20T15:24:46.782Z","modified":"2026-10-28T02:30:51.053388852Z","cvss":null,"epss":null,"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"PyPI","name":"picklescan","fixedVersion":"1.0.1"}],"fix":{"url":"https://github.com/mmaitre314/picklescan/pull/60","label":"mmaitre314/picklescan#60"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/56xxx/CVE-2026-56304.json"},{"type":"ADVISORY","url":"https://github.com/mmaitre314/picklescan/security/advisories/GHSA-m7j5-r2p5-c39r"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-56304"},{"type":"ADVISORY","url":"https://www.vulncheck.com/advisories/picklescan-arbitrary-file-creation-via-logging-filehandler-deserialization"},{"type":"WEB","url":"https://github.com/mmaitre314/picklescan/pull/60"},{"type":"WEB","url":"https://github.com/mmaitre314/picklescan/commit/4d9bc9cd34bca8672dad3481cd4556d5ba747156"},{"type":"PACKAGE","url":"https://github.com/mmaitre314/picklescan"},{"type":"WEB","url":"https://github.com/mmaitre314/picklescan/releases/tag/v1.0.1"},{"type":"WEB","url":"https://github.com/pypa/advisory-database/tree/main/vulns/picklescan/PYSEC-2026-225.yaml"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-10-28T02:30:51.053388852Z"}}