appsec.fyi

Python Resources

Post Share

A curated AppSec resource library covering XSS, SQLi, SSRF, IDOR, RCE, XXE, OSINT, and more.

Python

Python has become one of the most widely used languages in cybersecurity — from writing exploit scripts and automation tools to building security scanners and processing large datasets. Its readability, extensive standard library, and rich ecosystem of security-focused packages make it the go-to language for security professionals.

In application security, Python appears on both sides: as the language used to build web applications (Django, Flask, FastAPI) and as the primary tool for testing them. Common Python security concerns include unsafe deserialization with pickle, command injection through os.system() and subprocess, SSTI in Jinja2 templates, path traversal in file operations, and SSRF in HTTP libraries like requests.

For offensive security, Python powers many essential tools — from Burp extensions and custom fuzzers to reverse shells and exploit proof-of-concepts. Libraries like pwntools, scapy, and impacket are staples in penetration testing. For defensive security, Python is used to build SIEM integrations, log analyzers, and automated incident response workflows.

This page collects Python security resources covering both secure coding practices for Python applications and Python-based security tooling for offensive and defensive work.

python.org

Date Added Link Excerpt
2026-04-29 NEW 2026LeRobot Vulnerability Enables Unauthenticated Remote Code Execution news RCEA critical vulnerability in LeRobot allows unauthenticated remote code execution. This means attackers can exploit the flaw to run their own code on a vulnerable LeRobot system without needing any credentials. The specific details of the exploit and its impact are available via the provided link. → letsdatascience.com
2026-04-28 NEW 2026Malicious Python package poses new supply chain threat news Supply ChainWriteup detailing a supply chain attack on the `elementary-data` Python package, which was compromised via a GitHub Actions vulnerability. Attackers stole signing keys to publish a malicious version (0.23.3) that exfiltrated user profiles, cloud keys, API tokens, SSH keys, and .env file contents. Users are advised to rotate credentials, remove the malicious package, and check for a marker file, noting CI/CD runners are particularly at risk. → techzine.eu
2026-04-24 NEW 2026Python Vulnerability Allows Out-of-Bounds Write on Windows Systems newsA critical vulnerability has been discovered in Python that permits out-of-bounds writes on Windows systems. This flaw could potentially lead to arbitrary code execution. While the vulnerability is significant, no specific bug bounty payout amount is mentioned in the provided content. Users of Python on Windows are advised to update to the latest version to mitigate this security risk. → cybersecuritynews.com
2026-04-24 NEW 2026Critical Python Vulnerability Enables Out-of-Bounds Write on Windows Systems newsA critical vulnerability has been discovered in Python that allows for an out-of-bounds write on Windows systems. This means an attacker could potentially corrupt memory and gain control of a system. The vulnerability is present in the `_ssl_io_write` function within the `_ssl` module. While the article mentions the criticality of the issue, it does not state a bug bounty payout amount. → cyberpress.org
2026-04-24 NEW 2026Python Vulnerability Enables Out-of-Bounds Write on Windows newsA vulnerability has been discovered in Python that allows for an out-of-bounds write when using the `uuid` module on Windows. This flaw could potentially lead to denial-of-service conditions or even remote code execution under specific circumstances. The vulnerability arises from how Python handles certain UUID formats on Windows. Further details and a technical breakdown are available via the provided link. The content does not specify a bug bounty payout amount. → gbhackers.com
2026-04-23 2026wapiti-scanner/wapiti: Web vulnerability scanner written in Python3 beginner API SecLibrary for "black-box" web vulnerability scanning in Python3, acting as a fuzzer to detect issues like SQL Injections, XSS, File Disclosure, Command Execution, XXE, CRLF Injection, Shellshock, SSRF, and Log4Shell (CVE-2021-44228) by attacking scripts and forms. It supports various reporting formats, session management for resuming scans, proxy integration, authenticated scans, URL scope limitation, cookie import from browsers, and includes modules for CMS enumeration, subdomain takeover detection, and security header checks.
2026-04-22 2026CVE-2025-68664: Critical LangChain Flaw Enables Secret Extraction newsWriteup of CVE-2025-68664, a critical serialization injection vulnerability in LangChain Core, enabling secret extraction and unintended object instantiation. The flaw, stemming from improper handling of the "lc" key during data serialization and deserialization, affects Python versions >= 1.0.0 and < 1.2.5 and < 0.3.81, and a similar issue, CVE-2025-68665, impacts LangChain.js. Exploitation involves crafting attacker-controlled LLM outputs that masquerade as trusted objects, leading to risks like secret leakage and network operations. Patched versions implement deserialization allowlists and disable environment-based secret loading by default.
2026-04-22 2026Bandit Python: Free SAST in 10 Seconds (2026 Review) beginnerLibrary for static analysis of Python code, Bandit identifies common security issues through Abstract Syntax Tree analysis. It ships with 47 built-in checks targeting vulnerabilities like hardcoded credentials, weak cryptography, and injection flaws, with specialized plugins for issues such as insecure Hugging Face model downloads (B615). Bandit offers flexible configuration, multiple output formats including SARIF, baseline comparisons for incremental scans, and integrates with pre-commit hooks and Docker. It’s recommended for Python projects needing a free, focused security linter to complement broader SAST solutions. → appsecsanta.com
2026-04-22 2026CVE-2026-22607: Fickling Python RCE Vulnerability newsWriteup of CVE-2026-22607 details an Insecure Deserialization vulnerability in Fickling, a Python pickling decompiler. Versions up to 0.1.6 incorrectly classify pickle files using `cProfile.run()` as "SUSPICIOUS" instead of "OVERTLY_MALICIOUS". This misclassification allows attackers to craft malicious pickle files, bypass Fickling's analysis, and achieve arbitrary code execution on systems relying on its security assessment for deserialization. → sentinelone.com
2026-04-22 2026CVE-2026-21226: Azure Core Python Library RCE Vulnerability newsLibrary for Python applications using Azure SDKs, addressing CVE-2026-21226, an insecure deserialization vulnerability (CWE-502). Attackers with low-level authorization can execute arbitrary code over a network by crafting malicious serialized payloads processed by the vulnerable Azure Core library. Mitigation involves updating the `azure-core` package via `pip install --upgrade azure-core` and implementing input validation or network segmentation. → sentinelone.com
2026-04-22 2026SGLang CVE-2026-5760 (CVSS 9.8) Enables RCE via Malicious GGUF Model Files news RCEWriteup on CVE-2026-5760, a CVSS 9.8 remote code execution vulnerability in SGLang. Attackers exploit this by crafting malicious GGUF model files with Jinja2 server-side template injection payloads in the `tokenizer.chat_template` parameter. Loading these models and hitting the `/v1/rerank` endpoint allows arbitrary Python code execution on the SGLang server, similar to CVE-2024-34359 (Llama Drama) and CVE-2025-61620 in vLLM. Mitigation involves using `ImmutableSandboxedEnvironment` for rendering templates. → thehackernews.com
2026-04-22 2026Marimo RCE Flaw CVE-2026-39987 Exploited Within 10 Hours of Disclosure news RCEWriteup on CVE-2026-39987, a pre-authenticated RCE vulnerability in Marimo exploited within 10 hours of disclosure. The flaw, unpatched until version 0.23.0, allowed unauthenticated attackers to gain a full PTY shell by connecting to the `/terminal/ws` WebSocket endpoint without proper authentication. Attackers leveraged the exploit for credential theft, environment variable extraction, and deployment of the NKAbuse variant via Hugging Face Spaces, with CISA adding it to the KEV catalog. → thehackernews.com
2026-04-22 2026Critical SQL Injection Vulnerability in Django (CVE-2025-64459) newsLibrary detailing CVE-2025-64459, a critical SQL injection vulnerability in Django that allows attackers to manipulate query logic via internal parameters like `_connector` and `_negated`. The analysis covers exploitation scenarios such as authentication bypass and data exfiltration, outlines the fix implemented in patched Django versions (5.2.8, 5.1.14, 4.2.26), and provides mitigation strategies including code review, parameter whitelisting, and testing for vulnerable patterns.
2026-04-22 2026CERT-FR Warns of Python/CPython RCE Vulnerabilities (CVE-2026-4786, CVE-2026-6100) newsCERT-FR Warns of Python/CPython RCE Vulnerabilities (CVE-2026-4786, CVE-2026-6100)
2026-04-22 2026Malicious PyPI Packages Deliver SilentSync RAT newsLibrary for Python package installers that delivers the SilentSync RAT. Malicious PyPI packages named `sisaws` and `secmeasure`, uploaded by the same author, are used to deploy SilentSync. This RAT enables remote command execution, file exfiltration, screen capturing, and web browser data theft from Chrome, Brave, Edge, and Firefox on Windows systems. The malicious packages leverage typosquatting and mimic legitimate library functionalities to evade detection.
2026-04-22 2026Bearer: SAST Tool to Discover, Filter, and Prioritize Security and Privacy Risks beginnerTool for static application security testing (SAST), Bearer scans source code to identify, filter, and prioritize security and privacy risks. It supports multiple languages including Go, Java, JavaScript, TypeScript, PHP, Python, and Ruby, with advanced cross-file analysis and additional languages available in its commercial version. Bearer CLI detects vulnerabilities based on OWASP Top 10 and CWE Top 25, such as Path Traversal (CWE-22), SQL Injection (CWE-89), and Cross-Site Scripting (CWE-79), and also identifies PII and PHI data flows for privacy compliance reporting.
2026-04-19 2026PyPI Supply Chain Attack: Colorama and Colorizr Name Confusion newsPyPI Supply Chain Attack: Colorama and Colorizr Name Confusion → checkmarx.com
2026-04-19 2026Compromised LiteLLM PyPI Package Delivers Credential Stealer news Supply ChainLibrary versions 1.82.7 and 1.82.8 of the popular Python package litellm, an abstraction for interacting with LLMs from providers like OpenAI and Google, were compromised on PyPI. This malicious code acted as a multi-stage credential stealer, exfiltrating sensitive data including API keys, cloud provider credentials, and Kubernetes secrets. The payload employed AES-256-CBC encryption for data and RSA for key protection, ultimately attempting to establish persistence via a system service and download further payloads from attacker-controlled infrastructure. → sonatype.com
2026-04-19 2026LiteLLM PyPI Package Compromised in TeamPCP Supply Chain Attack newsLibrary compromised in a supply-chain attack, where malicious versions of the LiteLLM Python package (1.82.7 and 1.82.8) were uploaded to PyPI by the TeamPCP hacking group. These versions deployed an infostealer that harvested sensitive data including SSH keys, cloud credentials, Kubernetes secrets, and cryptocurrency wallet data. The payload also attempted lateral movement and installed a persistent systemd backdoor, exfiltrating data to attacker-controlled infrastructure. Organizations are advised to rotate credentials and inspect systems for persistence artifacts. → bleepingcomputer.com
2026-04-19 2026Malicious PyPI Package — LiteLLM Supply Chain Compromise newsWriteup detailing the LiteLLM supply chain compromise, where malicious Python `.pth` files in `site-packages/` automatically execute embedded, double base64-encoded payloads. These payloads exfiltrate environment variables, SSH keys, and cloud credentials to attacker-controlled servers like `models[.]litellm[.]cloud`. The attack, attributed to TeamPCP, exploits versions 1.82.8 and potentially 1.82.7 of LiteLLM, necessitating immediate credential rotation and checks for suspicious `.pth` files.
2026-04-19 2026The PyPI Supply Chain Attacks of 2025 news Supply ChainThe PyPI Supply Chain Attacks of 2025
2026-04-16 2026PYPI Security: How to Prevent Supply Chain Attacks in Python Projects beginnerPYPI Security: How to Prevent Supply Chain Attacks in Python Projects
2026-04-16 2026Python Tools for Penetration Testers beginnerLibrary offering Python tools for penetration testers, vulnerability researchers, and reverse engineers. It lists libraries and programs for packet manipulation (Scapy, Impacket, dpkt), network reconnaissance (AutoRecon, Mitm6, SMBMap), web application security (XSStrike, Powerfuzzer, waymap), fuzzing (afl-python, Peach Fuzzing Platform), disassembly and emulation (Capstone, Unicorn Engine, Frida, Angr), memory analysis (Volatility, Rekall), and reverse engineering of applications (Androguard, Ghidatron, pefile).
2026-04-16 2026Escalating Deserialization Attacks in Python intermediateLibrary for escalating Python deserialization attacks, demonstrating how insecure deserialization with `pickle` can lead to Remote Code Execution (RCE). The entry details how to exploit Python 2 and Python 3 vulnerabilities using techniques like `__reduce__` methods, `eval`, `compile`, and `exec` to achieve code injection and access sensitive files like `/etc/passwd` without leaving obvious artifacts of direct shell access.
2026-04-16 2026Exploiting Python Pickles - David Hamann intermediateWriteup detailing the exploitation of Python's `pickle` module for remote code execution. It explains how the `__reduce__` method can be abused during deserialization to execute arbitrary commands, demonstrating this with a Flask application and a reverse shell payload. The writeup emphasizes the security risks of unpickling untrusted data and suggests alternatives like JSON or data signing.
2026-04-16 2026Attack on Software Supply Chains Using Fake Python Infrastructure intermediateAttack on Software Supply Chains Using Fake Python Infrastructure → checkmarx.com
2026-04-16 2026Defense in Depth: A Practical Guide to Python Supply Chain Security beginnerLibrary for Python supply chain security, detailing defenses against attacks like the Ultralytics compromise. It advocates for layered security, starting with static analysis using Ruff, dependency pinning with cryptographic hashes via uv, and vulnerability scanning with pip-audit. The library also covers generating SBOMs with CycloneDX for rapid impact assessment, and adopting Trusted Publishing with OIDC for secure package distribution, emphasizing that no single control is perfect but multiple layers mitigate risk.
2026-04-16 2026How Python Pickle Deserialization Security Exploit Works intermediateLibrary for understanding Python pickle deserialization exploits, detailing how attackers can achieve arbitrary code execution by crafting malicious pickle payloads, often leveraging the `__reduce__` method for command injection via functions like `os.system`. The resource highlights common attack vectors such as insecure file uploads and vulnerable API endpoints that blindly deserialize untrusted data, leading to real-world impacts like remote code execution and data breaches.
2026-04-16 2026Insecure Deserialization in Python: Attack Techniques and Secure Coding intermediateLibrary for understanding and mitigating insecure deserialization vulnerabilities in Python. It details attack techniques using Python's `pickle`, `PyYAML` (specifically `yaml.load`), `jsonpickle`, `shelve`, and `marshal`. The resource covers how attackers fingerprint applications, craft payloads like reverse shells and OS command injection, and deliver them via HTTP, and includes steps for post-exploitation such as privilege escalation and lateral movement. Secure coding practices, including using `yaml.safe_load`, are also discussed.
2026-04-16 2026The Complete Guide on Python for Cyber Security beginnerLibrary for integrating Python into cybersecurity workflows, aiding penetration testers, security analysts, incident responders, researchers, and network security engineers. It leverages Python's readability, extensive libraries like Requests, Scapy, Pandas, PyTorch, pwntools, Atheris, CrowdStrike FalconPy, vt-py, YARA, pySigma, and PyMISP, and its versatility to automate tasks, build exploits, analyze data, detect anomalies, and manage infrastructure, supporting tools like Nmap, Metasploit, and Burp Suite.
2026-04-13 2026Critical flaw in Marimo Python notebook exploited within 10 hours of disclosure newsWriteup of CVE-2026-39987, a critical pre-authentication RCE vulnerability in Marimo Python notebooks, which allows unauthenticated attackers to gain a full shell and execute arbitrary commands. Exploited within 10 hours of disclosure, this flaw affects Marimo versions prior to 0.23.0 and enables credential theft in under three minutes. The vulnerability stems from an unauthenticated terminal WebSocket endpoint, highlighting risks in AI-adjacent developer tools like MLflow and Langflow. → csoonline.com
2026-04-10 2026This Python notebook flaw shows how fast hackers are acting on advisories newsThis Python notebook flaw shows how fast hackers are acting on advisories https://ift.tt/U56juBE → cybernews.com
2026-04-10 2026Python CVE Details beginnerPython CVE Details
2026-04-10 2026Python Security Vulnerabilities CVE Database beginnerPython Security Vulnerabilities CVE Database
2026-04-10 2026Picklescan Allows RCE via Malicious Pickle File intermediateAdvisory GHSA-655q-fx9r-782v details a remote code execution (RCE) vulnerability in Python's pickle module. Attackers can craft malicious pickle files that bypass static analysis tools like Picklescan by leveraging `pip.main()` for installation of a compromised package. This allows arbitrary code execution during deserialization, impacting systems that process untrusted pickle data and enabling supply chain attacks.
2026-04-10 2026CVE-2025-56005: PLY RCE Vulnerability newsLibrary vulnerability analysis of CVE-2025-56005 in Dabeaz PLY version 3.11, detailing an insecure deserialization flaw within an undocumented `picklefile` parameter of the `yacc()` function. This allows Remote Code Execution (RCE) through malicious pickle files, a risk amplified by the parameter's obscurity. The analysis includes technical details on the attack vector, root cause (CWE-502), detection methods, and mitigation strategies, while noting ongoing disputes regarding the CVE's validity. → sentinelone.com
2026-04-10 2026Multi-Stage Malware Attack on Python Package Index advancedTool for verifying Python Package Index (PyPI) dependencies, specifically addressing the chimera-sandbox-extensions malware that harvested developer credentials and environment variables. It emphasizes implementing curated package registries, software composition analysis within CI/CD pipelines, lock file usage, and hash-based verification to prevent supply chain attacks. The tool supports techniques like static and dynamic analysis to detect credential harvesting and DGA calls, alongside runtime sandboxing and secret management to mitigate risks from compromised dependencies.
2026-04-10 2026CVE-2025-1716 Sonatype Security Advisory newsAdvisory detailing CVE-2025-1716, an unsafe deserialization vulnerability in Python's `pickle` module, allowing bypass of static analysis tools like `picklescan`. An attacker can craft a malicious model using `pickle` to execute `pip.main()` and install a compromised PyPI package, leading to remote code execution. The vulnerability, CWE-184, stems from `pip` not being treated as an unsafe global by `picklescan` before version 0.0.21. Sonatype recommends upgrading to version 0.0.22 or higher for mitigation. → sonatype.com
2026-04-10 2026Picklescan Fails to Detect Unsafe Globals Advisory intermediateLibrary advisory details a bypass of Picklescan by an unsafe deserialization vulnerability in Python's pickle module. Attackers can leverage `pip.main()` during unpickling to install a malicious package, achieving remote code execution (RCE) via the package's `setup.py` or entry points. This technique allows for silent exploitation and supply chain attacks, as the use of `pip` may not trigger typical security alerts.
2026-04-10 2026CVE-2025-1716: Picklescan Analysis Bypass RCE newsWriteup of CVE-2025-1716, detailing an unsafe deserialization vulnerability in Python's pickle module. Attackers can bypass static analysis tools like Picklescan by exploiting `pip.main()` during deserialization, leading to the installation of malicious packages and subsequent remote code execution (RCE). The exploit leverages `pip install` to fetch and run arbitrary code from setup.py or post-install hooks, making it a potent supply chain attack vector.
2026-04-10 2026Critical Python PLY Library Vulnerability Enables RCE newsCritical Python PLY Library Vulnerability Enables RCE → cyberpress.org
2026-04-10 2026CVE-2025-56005: Python PLY Flaw Enables Remote Code Execution newsLibrary for hardening Python applications against the CVE-2025-56005 remote code execution vulnerability in the PLY (Python Lex-Yacc) library. This flaw exploits unsafe pickle deserialization when loading cached parser tables via the undocumented `picklefile` parameter, allowing arbitrary code execution during application startup before traditional security controls are active. The library addresses this by promoting secure deserialization practices, filesystem hardening for parser cache locations, and pipeline protections to prevent artifact poisoning. → esecurityplanet.com
2026-04-10 2026CVE Search: Python beginnerCVE Search: Python
2026-04-10 2026Python CVE Details beginnerPython CVE Details
2026-04-10 2026Python Security Vulnerabilities & Risk Score beginnerLibrary providing a comprehensive security risk assessment for Python, analyzing 349 vulnerabilities with EPSS scores, exploitation status, and remediation availability. It identifies specific weaknesses like `shutil.unpack_archive()` handling of Windows absolute paths, `BaseCookie.js_output()` character neutralization, and out-of-bounds writes in `asyncio.ProacterEventLoop.sock_recvfrom_into()`. The data includes CVEs such as CVE-2026-5713 for mote debugging, CVE-2026-4786 for command injection via `webbrowser.open()`, CVE-2026-6100 for use-after-free in decompression, and CVE-2026-1502 for HTTP client proxy tunnel validation issues, alongside Pillow's vulnerability to FITS GZIP decompression bombs.
2026-04-10 2026Python Security Vulnerabilities in 2026 beginnerSurvey of Python security vulnerabilities impacting versions up to 3.15.0, detailing CVEs such as CVE-2026-6019 (XSS via Morsel.js_output), CVE-2026-3298 (OOB Buffer Write in ProactorEventLoop), and CVE-2026-5713 (Privileged Memory Access via Profiling/Asyncio Introspection). The analysis also highlights issues like command injection in webbrowser.open (CVE-2026-4786), CRLF injection in http.client, and quadratic complexity DoS vulnerabilities in xml.dom.minidom and HTMLParser. The resource also touches upon resource exhaustion in plistlib and various tarfile module vulnerabilities including filter bypass, arbitrary filesystem writes, and infinite loops.
2026-04-10 2026RCE With Modern AI/ML Formats and Python Libraries intermediateLibrary vulnerabilities in NVIDIA's NeMo, Salesforce's Uni2TS, and Apple/ETH Zurich's FlexTok allow for remote code execution (RCE) when malicious metadata is loaded. These PyTorch-based AI/ML libraries, widely used on HuggingFace, leverage Hydra's `instantiate()` function to load configurations, inadvertently executing arbitrary code embedded in metadata. CVE-2025-23304 (NeMo) and CVE-2026-22584 (Uni2TS) have been assigned, with fixes released by the respective vendors. → unit42.paloaltonetworks.com
2026-04-10 2026Critical PickleScan Vulnerabilities Expose AI Model Supply Chains newsWriteup of CVE-2025-10155, CVE-2025-10156, and CVE-2025-10157, three critical vulnerabilities in PickleScan. These flaws enable attackers to bypass model scanning safeguards and distribute malicious AI models by exploiting file extension misclassifications, divergent ZIP archive handling between PickleScan and PyTorch, and evasion of dangerous import blacklisting through subclassing. The vulnerabilities, with a CVSS score of 9.3, underscore risks in AI supply chains and highlight the need for layered defenses and safer formats like Safetensors. → infosecurity-magazine.com
2026-04-10 2026How a Poisoned Security Scanner Backdoored LiteLLM intermediateLibrary that suffered a supply chain attack via Trivy and Checkmarx KICS, resulting in malicious versions (1.82.7 and 1.82.8) of the litellm Python package being published to PyPI. The attack involved credential harvesting through a compromised GitHub Action and the use of .pth files for persistence, enabling data exfiltration and lateral movement within Kubernetes environments. → snyk.io
2026-04-06 2026Rapid Exploitation and Clever Malware in the Supply Chain — Last Week in AppSec newsRapid Exploitation and Clever Malware in the Supply Chain — Last Week in AppSec → checkmarx.com

Frequently Asked Questions

What are common Python security vulnerabilities?
Common Python security issues include unsafe deserialization with pickle, command injection through os.system() and subprocess with shell=True, Server-Side Template Injection in Jinja2, path traversal in file operations, SSRF in the requests library, and SQL injection when using string formatting instead of parameterized queries.
Why is Python popular in cybersecurity?
Python's readability, extensive standard library, and rich ecosystem of security packages make it ideal for exploit development, automation, and tool building. Libraries like pwntools, scapy, impacket, and requests are widely used in penetration testing. Python is also the primary language for Burp Suite extensions (via Jython) and many security scanners.
How do you write secure Python code?
Use parameterized queries for database access, avoid pickle for untrusted data (use JSON instead), never use eval() or exec() on user input, use subprocess with shell=False and explicit argument lists, validate and sanitize file paths to prevent traversal, and keep dependencies updated to patch known vulnerabilities.

Weekly AppSec Digest

Get new resources delivered every Monday.