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

Read the Python guideA long-form, source-cited deep dive synthesized from every resource below. The comprehensive Python guide on chs.usA hand-written, in-depth practitioner guide — attacks, testing, and prevention.
Date Added Link Excerpt
2026-08-11 NEW 2026Python Software Foundation - Python 3.11.0a3 to 3.15.0b2 news 12 min read RCEWriteup of CVE-2026-12003 detailing an insecure input validation vulnerability in Python versions 3.11.0a3 to 3.15.0b2. This flaw, specifically affecting Windows releases installed for all users, allows low-privilege users to escalate privileges by creating specific files outside the Python installation directory, which are then executed by a privileged user or service account. The vulnerability, classified as Uncontrolled Search Path Element (CWE-427), can lead to code execution and privilege escalation. → bishopfox.com
2026-08-08 2026Flaws in Google APK for Python Unlock Agent-to-Agent Attack intermediateThis article details security vulnerabilities found in Google's APK for Python that allow for agent-to-agent attacks. These flaws enable unauthorized access and manipulation between different agents, potentially compromising sensitive data or control. The exact payout amount for reporting these vulnerabilities is not specified in the provided content. → darkreading.com
2026-07-30 2026How I Found a High-Severity Directory Traversal in Flask-Admin intermediate 4 min read RCELibrary demonstrating a high-severity Directory Traversal vulnerability in Flask-Admin's FileAdmin. The vulnerability stems from using a simple `startswith()` string comparison to enforce filesystem boundaries, which can be bypassed by exploiting directory path prefixes. This bypass affects download, upload, rename, delete, and directory creation operations, allowing unauthorized access outside the configured root directory. → infosecwriteups.com
2026-07-22 2026Leaking internal headers in Flask Ninja with deserialization intermediate 5 min read DeserWriteup on a Flask Ninja deserialization vulnerability where an attacker can leak internal headers. By crafting a malicious pickled `BearerAuth` object or influencing its configuration, an attacker can trick the framework's `HttpBearer.__call__` method into reading a header specified in the pickled object instead of the standard `Authorization` header, allowing for the exfiltration of sensitive information like reverse proxy injected headers. This issue impacts Flask Ninja applications that deserialize untrusted input and reflect rejected credentials.
2026-07-16 2026HN Security - My Semgrep C/C++ ruleset is ready for prime time again intermediate 5 min read SecretsLibrary featuring 50+ Semgrep rules for C/C++ vulnerability research, updated to version 2.0.0. It enhances static analysis by detecting dangerous API calls like `str*`, `mem*`, and `*printf` functions, improves pattern matching for memory allocations, and optimizes performance. The ruleset prioritizes identifying potential vulnerability hotspots over eliminating all false positives, serving as an assistant for developers and researchers rather than a fully automated CI/CD tool. It has been tested against NIST SAMATE test cases and is available in the official Semgrep registry.
2026-07-01 2026Shipping post-quantum cryptography to Python intermediate 4 min readLibrary providing post-quantum cryptography support for Python's pyca/cryptography package. This release introduces ML-KEM (NIST-standard key-establishment) and ML-DSA (NIST-standard digital signatures), enabling migration for applications like Ansible and Certbot. While offering quantum resistance, these primitives have larger data sizes and different integration tradeoffs compared to classical algorithms such as Ed25519 and X25519. Future work includes implementing SLH-DSA and protocol integration. → blog.trailofbits.com
2026-06-27 2026BadHost - One character and your AI agent switches sides intermediate 3 min readWriteup on CVE-2026-48710 (BadHost), a critical vulnerability in Starlette, the Python framework powering FastAPI, vLLM, and LiteLLM. A single character in the HTTP "Host" header can bypass path-based access controls, allowing unauthorized access to sensitive endpoints and data. This impacts numerous AI agent deployments. A scanner by Nemesis and X41 D-Sec can test exposure, and patching Starlette to 1.0.1 or higher, or using `request.scope["path"]`, are recommended fixes.
2026-06-25 2026Taming our Python dependencies at Microsoft with AI intermediate 9 min readTool, the Python Dependency Remediation extension for Visual Studio Code, uses AI to automatically analyze and update Python dependencies, significantly reducing remediation time and complexity for developers. This solution addresses the challenge of deeply interconnected dependency chains and the accumulation of vulnerabilities that arise from developers avoiding manual updates due to the intricate web of library relationships. → microsoft.com
2026-06-25 2026Hunting Leaked PyPI Tokens: 62 Live, 125 Packages Exposed intermediate 4 min read Secrets Supply ChainAnalysis of leaked PyPI tokens reveals 62 live credentials, impacting 125 packages with approximately 25,000 monthly downloads. Using the `pypitoken` Python module, researchers decoded macaroons to identify token restrictions, such as `UserIDRestriction` and `ProjectIDsRestriction`. A method mimicking the `twine upload` command was employed to test token validity, with a 400 HTTP response indicating a live token. Despite GitHub's automated scanning, numerous tokens, many first leaked in 2024, remained active, suggesting gaps in automated detection. Responsible disclosure to the PyPI security team led to token revocation and improvements in their disclosure process. → blog.gitguardian.com
2026-06-23 2026File encryption in Python: An in-depth exploration of symmetric and asymmetric techniques intermediate 7 min readLibrary for Python file encryption, detailing symmetric and asymmetric techniques. It covers Amazon's Key Management Service (KMS) with the `aws-encryption-sdk` for envelope encryption, and PyNaCl's `SecretBox` for symmetric file encryption and decryption. Additionally, it explores asymmetric encryption using PyNaCl's public/private box, emphasizing secure key management and communication. → snyk.io
2026-06-22 2026Code injection in Python: examples and prevention intermediate 7 min read RCELibrary for identifying and preventing code injection vulnerabilities in Python applications. It details common exploitation vectors, including insecure use of `eval()`, improper handling of user-controlled inputs, lack of input validation, dynamic code construction, and insecure deserialization. The library advocates for secure coding practices such as input sanitization, using safer alternatives like `literal_eval()`, parameterized queries, and strong access controls to mitigate these risks. → snyk.io
2026-06-21 2026Command injection in Python: examples and prevention intermediate 10 min read RCELibrary for preventing command injection vulnerabilities in Python applications, detailing how unsanitized user input passed to system shells via methods like `os.system()`, `subprocess.run(shell=True)`, dynamic command construction, and `eval()` can lead to exploits. It covers common scenarios, including vulnerabilities found in MLflow and PaddlePaddle, and emphasizes proactive mitigation through rigorous input validation, sanitization, and the use of parameterized queries to keep commands and data separate. → snyk.io
2026-06-21 2026Mastering Python virtual environments: A complete guide to venv, Docker, and securing your code intermediate 6 min readLibrary for managing Python virtual environments using `venv`, `virtualenv`, and `pipenv`, and securing Dockerized Python applications with Snyk. It details the creation, activation, and usage of isolated Python environments to prevent dependency conflicts, ensuring reproducible development workflows. The library also covers containerizing Python applications with Docker, including Dockerfile creation and execution, and vulnerability scanning with Snyk to enhance application security. → snyk.io
2026-06-21 2026Understanding and mitigating the Jinja2 XSS vulnerability (CVE-2024-22195) intermediate 3 min read XSSWriteup on CVE-2024-22195, a cross-site scripting vulnerability in the Jinja2 templating library affecting all versions prior to 3.1.3. The vulnerability arises from the `xmlattr` filter when keys contain spaces, allowing attackers to inject arbitrary HTML attributes and execute untrusted scripts. The article details reproduction steps and recommends upgrading to Jinja2 version 3.1.3. It also highlights the utility of tools like Snyk for continuous vulnerability monitoring in projects and containerized applications. → snyk.io
2026-06-19 2026The ultimate guide to creating a secure Python package beginner 14 min readGuide to creating secure Python packages, this tutorial details package structure, naming conventions, and configuration using `pyproject.toml`. It covers importing, installing from PyPI and private indexes with TLS recommendations, and specifying dependencies like NumPy. Modern packaging practices using `setuptools` as a build backend are emphasized over older `setup.py` methods. → snyk.io
2026-06-19 2026Symmetric vs. asymmetric encryption: Practical Python examples beginner 14 min readLibrary implementing symmetric and asymmetric encryption in Python, demonstrating practical use cases with examples for TLS/SSL, end-to-end messaging, and secure data storage. It covers algorithms like DES, 3DES, and AES, with a focus on envelope encryption for secure key management, using AWS KMS and the AWS Encryption SDK for practical implementation. → snyk.io
2026-06-19 2026How to secure Python Flask applications intermediate 14 min read API SecLibrary for securing Python Flask applications, addressing common vulnerabilities like XSS, CSRF, and SQL injection. It details insecure configurations such as secret key exposure, enabled debug mode in production, and unprotected sensitive data in configuration files. The guide recommends best practices including using environment variables for credentials, securely generating secret keys with the `uuid` module, and utilizing the Snyk platform for vulnerability detection and mitigation within IDEs and CI pipelines. → snyk.io
2026-06-18 2026Ultralytics AI Library Hacked via GitHub for Cryptomining intermediate 4 min read Supply ChainLibrary exploiting GitHub Actions for supply chain attack. Versions 8.3.41 and 8.3.42 of the Ultralytics Python package were compromised, injecting XMRig cryptominer. The attack leveraged a vulnerability in the "Publish Docs" workflow, allowing arbitrary code execution via crafted branch names. This impacted not only Ultralytics but also dependent packages like ComfyUI Impact Pack, highlighting risks in CI/CD pipelines and popular AI libraries. → wiz.io
2026-06-10 2026Three’s a Crowd: TeamPCP trojanizes LiteLLM in Continuation of Campaign news 3 min read Secrets Supply ChainWriteup detailing the TeamPCP campaign's exploitation of LiteLLM, specifically versions 1.82.7 and 1.82.8, which utilized Python's .pth mechanism for stealthy code execution. This attack, building on prior compromises of Trivy and Checkmarx GitHub Actions, exfiltrates cloud credentials, CI/CD secrets, and various keys to attacker-controlled domains, posing a significant risk to environments utilizing the LiteLLM library. → wiz.io
2026-06-09 2026Snyk and uv, Better Together intermediate 3 min read AILibrary that pairs uv, a high-performance Python package manager, with Snyk for application security. This integration enables native CycloneDX SBOM export from uv, allowing Snyk to scan dependencies for vulnerabilities and license compliance. The partnership also introduces native uv support within the Snyk CLI and IDE integrations, aiming to provide built-in security for AI-native Python applications, ensuring speed and security are not mutually exclusive. → snyk.io
2026-06-09 2026How a Poisoned Security Scanner Became the Key to Backdooring LiteLLM news 9 min read RCE Supply ChainLibrary containing a backdoor that exploited Trivy security scanner vulnerabilities to compromise LiteLLM Python packages, specifically versions 1.82.7 and 1.82.8. The malicious code was delivered via direct source injection or a `.pth` file, leading to credential theft, data exfiltration using AES-256 and RSA encryption, and persistence through systemd services and Kubernetes lateral movement. This attack chain is linked to the threat actor TeamPCP, identified by consistent infrastructure and an RSA public key shared with prior Trivy and KICS compromises. → snyk.io
2026-06-08 2026durabletask: TeamPCP's Latest PyPi Compromise news 2 min read Supply ChainAnalysis of the TeamPCP supply chain attack details the compromise of Microsoft's official Python client, durabletask, specifically versions 1.4.1, 1.4.2, and 1.4.3. The attack leveraged compromised GitHub credentials to exfiltrate PyPI tokens and publish malicious code, targeting Microsoft's `durabletask-python` repository. Remediation steps include identifying exposure via lockfiles and CI logs, checking for persistence markers like `~/.cache/.sys-update-check`, rotating all credentials, auditing AWS SSM and Kubernetes activity, reviewing password manager sessions, and blocking C2 infrastructure. → wiz.io
2026-06-05 2026Type Level Security for Secure AI Code Generation advanced 6 min readLibrary implementing type-level security to prevent vulnerabilities like Insecure Direct Object Reference (IDOR) and DOM XSS. It demonstrates code patterns in Python and Rust, showcasing how opaque types and access restrictions can enforce authentication and authorization checks at compile or lint time, ensuring secure data handling for both human developers and AI code generation. → snyk.io
2026-05-20 2026Microsoft's durabletask package on PyPi Compromised. Mini Shai Hulud attacks again... again! news 8 min readLibrary versions 1.4.1, 1.4.2, and 1.4.3 of Microsoft's `durabletask` Python package on PyPI were compromised with a dropper that executes a sophisticated infostealer and worm. This payload targets credentials from cloud providers, password managers, and developer tools, propagating via SSM or kubectl in cloud environments. It also includes a destructive component triggered by specific system locales. The malware exfiltrates data encrypted with an RSA key and utilizes a GitHub-based dead-drop for command and control. → aikido.dev
2026-05-12 2026What AI 'fingerprints' helped expose the 1st AI-made zero-day exploit? | The exploit was a Python script beginnerResearchers discovered the first zero-day exploit generated by AI. The exploit was written as a Python script. The article's title suggests that unique "AI fingerprints" were crucial in identifying this novel threat, distinguishing it from human-crafted exploits. This marks a significant development in cybersecurity, highlighting AI's potential for both creating and detecting sophisticated attacks. The specific details of these "fingerprints" and how they led to the exposure of the exploit are likely discussed within the linked content.
2026-05-10 2026JDownloader Website Supply Chain Attack: Installers Replaced with Python RAT Malware (May 2026) news 5 min readWriteup of the JDownloader website supply chain attack (May 2026), detailing how an unpatched CMS vulnerability allowed attackers to replace Windows and Linux installers with a Python RAT and ELF binaries respectively. The attack, active for approximately 24 hours, utilized obfuscation and persistence techniques, including SUID-root binaries for Linux. This incident highlights the risks of unauthorized changes to web content and the importance of verifying digital signatures. → rescana.com
2026-05-08 2026Linux Kernel Elevation of Privilege Vulnerability news 1 min readWriteup on CVE-2026-31431, a "Copy Fail" logic bug in the Linux kernel's authencesn cryptographic template. This vulnerability allows an unprivileged local user to perform a deterministic, controlled 4-byte write into the page cache of any readable file, enabling elevation of privilege to root. The exploit is a 732-byte Python script that can modify setuid binaries, impacting all Linux distributions shipped since 2017. Vendor-specific fixes are available for Ubuntu, Debian, Red Hat, SUSE, Amazon, Arch, AlmaLinux, Cloudlinux, and Gentoo. → hkcert.org
2026-05-05 2026Bootstrap script exposes PyPI to domain takeover attacks news 8 min read Supply ChainLibrary detailing a domain takeover vulnerability in legacy Python package bootstrap scripts. The vulnerability, discovered by ReversingLabs, affects numerous packages including tornado and slapos.core, by exploiting the now-available python-distribute[.]org domain. This could allow attackers to execute arbitrary code when developers run affected bootstrap scripts, potentially impacting software supply chain security. → reversinglabs.com
2026-05-02 2026Script Injection and Data Theft: Python Data Analysis Tool Compromised intermediate 2 min read RCETool update compromise elementary-data (version 0.23.3) allowed script injection via GitHub Actions workflows, leading to theft of SSH keys, AWS credentials, API tokens, and cryptocurrency wallet files. The malicious package was available on PyPI and as a Docker image. Countermeasures include uninstalling the compromised version, installing 0.23.4, renewing credentials, and checking for malware marker files. This incident is cataloged as MAL-2026-3083 in OSV.
2026-05-01 2026"Copy Fail": Linux root in all major distributions with 732 bytes of Python intermediate 2 min read RCEWriteup of CVE-2026-31431, "Copy Fail," a Linux kernel vulnerability allowing local privilege escalation. This logic error enables a deterministic 4-byte write to the page cache of any readable filesystem, exploitable with a 732-byte Python script. The vulnerability, discovered with AI assistance and affecting major distributions since 2017, can be mitigated by blocking AF_ALG socket creation or blacklisting the algif_aead module.
2026-04-30 2026New Linux 'Copy Fail' Vulnerability Enables Root Access on Major Distributions news 2 min read RCELibrary for detecting and mitigating the "Copy Fail" vulnerability (CVE-2026-31431), a Linux kernel flaw in the algif_aead module. This high-severity issue allows unprivileged local users to gain root access by writing controlled bytes into the page cache of any readable file, targeting setuid binaries like `/usr/bin/su`. The exploit, a small Python script, corrupts the page cache of files it doesn't own, bypassing sandboxing and affecting distributions shipped since 2017, including RHEL and Ubuntu. → thehackernews.com
2026-04-23 2026wapiti-scanner/wapiti: Web vulnerability scanner written in Python3 beginner 5 min read 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 news 4 min readWriteup 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. → socradar.io
2026-04-22 2026Bandit Python: Free SAST in 10 Seconds (2026 Review) beginner 3 min readLibrary 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 news 4 min readWriteup 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 news 4 min readLibrary 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 2 min read 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 3 min read 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) news 4 min readLibrary 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. → endorlabs.com
2026-04-22 2026Malicious PyPI Packages Deliver SilentSync RAT news 7 min readLibrary 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 beginner 8 min readTool 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 news 5 min readLibrary of malicious Python packages exploiting typo-squatting and name-confusion attacks against the Colorama library on PyPI. These packages, designed to mimic legitimate libraries, deliver payloads for persistent remote access, data exfiltration, and attempts to evade antivirus controls on both Windows and Linux systems. The campaign exhibits cross-ecosystem tactics, using NPM package names to target PyPI users, and features sophisticated persistence mechanisms and stealth techniques. → checkmarx.com
2026-04-19 2026Compromised LiteLLM PyPI Package Delivers Credential Stealer news 6 min read 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 news 3 min readLibrary 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 news 1 min readWriteup 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 beginner 6 min readLibrary 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 intermediate 7 min readLibrary 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 intermediate 5 min readWriteup 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.

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.