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
Python sits on both sides of this library
Two distinct bodies of work end up under this tag, and it helps to know which one you are reading. The first is Python as the language security work is written in: request handling, parsing, concurrency, and the small details that separate a script that works once from a tool you can point at a thousand hosts. The second is Python as an attack surface — the features and libraries that introduce vulnerabilities into applications written in it.
On the second: Python's dangerous edges are mostly about evaluation and
deserialization. pickle executes code by design, which makes any
pickle from an untrusted source equivalent to remote code execution, and it
still turns up in caches, session stores and message queues.
eval and exec need no explanation;
yaml.load without a safe loader is the same bug wearing a
configuration file. Format-string and f-string constructs that touch attacker
input can reach object internals. Subprocess calls with
shell=True are command injection whenever the argument is not
fully controlled. Jinja2 SSTI is common enough that it has its own topic on
this site, and the escape chains there run through exactly these primitives.
Packaging deserves its own attention. Installing a package runs its build code, dependency confusion against internal index names is a live technique rather than a theoretical one, and typosquatted names on PyPI are a recurring event. If you write Python tooling, pinning and hash-checking your own dependencies is security work, not hygiene theatre.
For tool building, the material here leans practical: async and threading
for scanning at scale, working with requests and raw sockets when
you need control over what goes on the wire, parsing hostile input without
crashing, and building Burp extensions or standalone utilities that fit an
existing workflow. If you are new, start with the tooling pieces — writing a
small scanner teaches the protocol details faster than reading about them.
| Date Added | Link | Excerpt |
|---|---|---|
| 2026-11-03 NEW 2026 | Python JSON Backups: Replace the File After the Write Succeeds beginner | This article discusses a method for safely backing up JSON files in Python. It proposes writing the new JSON data to a temporary file first, and only replacing the original file with the temporary one *after* the write operation has successfully completed. This approach ensures that a corrupted or incomplete backup file won't overwrite the existing, valid JSON data, thereby preventing data loss in case of a failure during the backup process. The focus is on a small file-writing boundary to protect the previous good copy. |
| 2026-11-03 NEW 2026 | “Yeahhh ! Sign in with Google ! ”: But What Actually Happens When You Click That Easy Button ? beginner AuthN | This article explains the behind-the-scenes mechanics of using "Sign in with Google." It details the OAuth 2.0, OpenID Connect, and PKCE protocols involved. Through step-by-step explanations and Django examples, the content aims to demystify the seemingly simple process of using third-party authentication, revealing the complex flow of authorization and identity verification that occurs when you click that convenient button. |
| 2026-11-03 NEW 2026 | Quasar: A Cross-Platform Subdomain Enumeration Framework for Modern Cybersecurity & Red Team… news Recon | This content is a title and publisher attribution for "Quasar: A Cross-Platform Subdomain Enumeration Framework for Modern Cybersecurity & Red Team…". The publisher is identified as eXecure - Execute Securely. No bug bounty payout amount is mentioned. |
| 2026-11-02 NEW 2026 | PyJWT: PyJWK accepts empty HMAC keys (CVE-2026-102266) news 6 min read AuthN JWT | Library vulnerability in PyJWT allows token forgery. CVE-2026-102266 arises because PyJWK accepts empty HMAC keys, unlike the direct `bytes` key path, leading to authentication bypass for HS256 tokens. Services using PyJWK or PyJWKSet with an empty symmetric JWK and disabled minimum key-length enforcement are affected, enabling attackers to forge valid JWTs without possessing the actual secret. |
| 2026-11-02 NEW 2026 | Breaking JWT Validation: How JSON Nulls, Python Booleans, and Unhandled Exceptions Bypass jwcrypto intermediate AuthN AuthZ JWT | This article details vulnerabilities in the `jwcrypto` library that allow attackers to bypass JSON Web Token (JWT) validation. By exploiting how `jwcrypto` handles JSON `null` values, Python `True`/`False` booleans, and unhandled exceptions, attackers can forge valid JWTs. This enables them to authenticate as any user or gain unauthorized access. The research highlights the critical importance of robust input validation and secure exception handling in cryptographic libraries to prevent such bypasses. No specific bounty payout amount is mentioned. |
| 2026-11-02 NEW 2026 | One Forgotten Key, One Poisoned Release: What the LiteLLM Supply-Chain Attack Means for Your… news AI Supply Chain | A supply-chain attack on LiteLLM, a popular open-source library for interacting with various LLM APIs, has been disclosed. The attack involved a compromised account that published a malicious version of the library. This poisoned release could potentially steal sensitive data like API keys and user information. The incident highlights the vulnerability of open-source software and the critical need for robust security practices within development pipelines. Users are advised to update to a secure version and review their systems for any signs of compromise. No bounty payout amount is mentioned in the provided title and content. |
| 2026-11-02 NEW 2026 | ZDI-26-797 Meta FAIRChem pickle deserialization news AI Deser | This advisory (ZDI-26-797) details a critical pickle deserialization vulnerability within Meta's FAIRChem software. Successful exploitation of this flaw allows an unauthenticated remote attacker to achieve arbitrary code execution by convincing a user to load a specially crafted pickle file. This could lead to significant compromise of systems running the vulnerable FAIRChem application. No bounty payout amount is specified in this content. → zerodayinitiative.com |
| 2026-11-02 NEW 2026 | ZDI-26-845 MLflow deserialization of untrusted data news AI Deser RCE | Advisory ZDI-26-845 details an MLflow Statsmodels _load_model deserialization vulnerability. Remote attackers can execute arbitrary code by tricking users into visiting a malicious page or opening a malicious file. This flaw arises from insufficient validation of user-supplied data, leading to the deserialization of untrusted input and code execution within the user's context. The vulnerability is fixed in MLflow 3.15.0. → zerodayinitiative.com |
| 2026-11-02 NEW 2026 | fsspec ReferenceFileSystem SSTI leads to RCE (CVE-2026-104851) news RCE SSTI | Writeup of CVE-2026-104851 in fsspec's ReferenceFileSystem, detailing how control over the "references" JSON document, supplied via URL, allows attackers to trigger un-sandboxed Jinja2 template rendering. This technique achieves arbitrary Python code execution before data is read, mirroring the RCE pattern seen in CVE-2024-34359 within llama-cpp-python. → advisories.gitlab.com |
| 2026-11-02 NEW 2026 | Wizarr authenticated Jinja2 SSTI to RCE (CVE-2026-108264) news RCE SSTI | A critical vulnerability (CVSS 9.1), CVE-2026-108264, has been identified in Wizarr. This bug allows authenticated users to perform Server-Side Template Injection (SSTI) during wizard step rendering, which can then lead to Remote Code Execution (RCE). The vulnerability is associated with the wizarrrr/wizarr project. It is not currently reported as actively exploited. Users should consult affected ranges and fixed versions for remediation. |
| 2026-11-02 NEW 2026 | Frappe Framework SSTI in message fields (CVE-2026-119144) news 1 min read RCE SSTI | Writeup of CVE-2026-119144 details a critical server-side template injection vulnerability in Frappe Framework. Unsanitized user-controlled message fields allow authenticated attackers to execute template expressions server-side, leading to high impact on confidentiality, integrity, and availability. Affected versions include Frappe Framework 16.0.0 through 16.20.x and versions before 15.111.0. Patches are available in Frappe 15.111.0 and 16.21.0, with immediate upgrading recommended, especially for network-reachable instances. |
| 2026-11-02 NEW 2026 | Frappe Builder SSRF guard bypass via redirects and DNS rebinding intermediate SSRF | Library that fixes SSRF guard bypasses in Frappe Builder versions prior to 1.36.1. Exploitation leveraged redirects and DNS rebinding to reach internal services and cloud metadata endpoints, including those in the 100.64.0.0/10 range. The vulnerability affected `builder.api.convert_to_webp`, `builder.api.import_remote_assets`, and `builder.api.import_remote_fonts`. Patches ensure addresses are re-checked on every redirect hop and only globally routable addresses are permitted. |
| 2026-11-02 NEW 2026 | MLflow unauthenticated full-read SSRF in webhook delivery intermediate 3 min read AI SSRF | Advisory for CVE-2026-64849 details an unauthenticated full-read SSRF vulnerability in MLflow's webhook delivery. The bypass of the `_validate_webhook_url` function is achieved through unvalidated HTTP redirects and DNS rebinding, allowing attackers to exploit a default MLflow Tracking Server's synchronous POST `/api/2.0/mlflow/webhooks/{id}/test` endpoint. This vulnerability, present in MLflow versions `>=3.3.0` and `<3.15.0`, has been added to the CISA Known Exploited Vulnerabilities catalog. |
| 2026-11-01 NEW 2026 | Authlib accepts empty HMAC key, allowing JWS/JWT forgery (CVE-2026-114616) news 3 min read AuthN JWT | Advisory for CVE-2026-114616 detailing Authlib's vulnerable handling of empty HMAC keys. This flaw allows for JWS/JWT forgery by enabling deterministic, reproducible digests when an empty key is used for signing and verification. This issue is similar to previously identified vulnerabilities in fast-jwt and ruby-jwt, and affects Authlib versions up to 1.7.2. The vulnerability arises because the library accepts zero-length keys, permitting attackers to craft arbitrary, valid tokens if the verification key can be an empty value at runtime. |
| 2026-11-01 NEW 2026 | Authlib JWT bearer grant accepts assertions for wrong audience intermediate 3 min read AuthN JWT | Library vulnerability, GHSA-fch4-3c6x-j4gc, impacts Authlib's default RFC 7523 JWT bearer grant. The `get_audiences()` function returning an empty list allows `verify_claims()` to accept JWT assertions with incorrect audience claims. An attacker can exploit this by presenting a valid JWT assertion intended for one authorization server to another sharing the same signing key, obtaining an access token through audience bypass. This improper authentication allows unauthorized access escalation across trust boundaries, especially in microservice architectures. |
| 2026-11-01 NEW 2026 | Nautobot Jinja2 sandbox escape enables arbitrary DB reads intermediate 1 min read SSTI | Advisory GHSA-9fgc-m542-2g84 details a Jinja2 template sandbox escape in Nautobot versions 2.4.42 and 3.2.5, allowing authenticated users to perform arbitrary database reads and exfiltrate sensitive information like API tokens. This incomplete fix for a prior advisory affects Computed Fields, Export Templates, and Custom Links, enabling account takeover. Patches are available in Nautobot 3.2.7 and 2.4.44, with the only workaround being restricting template-authoring permissions. |
| 2026-11-01 NEW 2026 | ZDI-26-839 MLflow PickleEvaluationArtifact deserialization RCE intermediate AI Deser RCE | Advisory detailing ZDI-26-839, a remote code execution vulnerability in MLflow due to improper validation of user-supplied data during the parsing of pickle files. This flaw allows remote attackers to execute arbitrary code in the context of the current process, requiring user interaction to exploit by visiting a malicious page or opening a malicious file. The vulnerability is fixed in MLflow 3.13.0. → zerodayinitiative.com |
| 2026-11-01 NEW 2026 | How a Pydantic Object Defeated a Jinja2 Sandbox: SSTI to RCE intermediate 9 min read RCE SSTI | Library for detecting and exploiting Server-Side Template Injection (SSTI) vulnerabilities, demonstrating how a Pydantic model's deprecated `parse_raw` method can be leveraged to bypass Jinja2's `SandboxedEnvironment` and achieve Remote Code Execution (RCE) with low-privilege authenticated users. It highlights that modern application objects, like Pydantic models, often expose deserialization functionalities that name-based sandboxes fail to guard against. |
| 2026-11-01 NEW 2026 | Frappe possibility of server-side template injection intermediate SSTI | An authenticated user with a common operational role could exploit server-side template injection in Frappe via user-controlled message fields. This vulnerability allows for the execution of template expressions, posing a security risk. The content does not specify a bounty payout amount. |
| 2026-11-01 NEW 2026 | Authlib: unvalidated request_uri fetch in JAR leading to SSRF intermediate 3 min read AuthN JWT SSRF | Library vulnerability in Authlib's RFC 9101 (JAR) extension allows for unvalidated `request_uri` fetches, leading to unauthenticated Server-Side Request Forgery (SSRF). The extension fails to validate attacker-controlled `request_uri` parameters before passing them to a fetch hook, even though an allowlist mechanism exists. Implementations following the library's documented pattern are susceptible to SSRF against internal services and cloud metadata endpoints. The vulnerability can be distinguished by distinct error types (`InvalidRequestUriError` vs. `InvalidRequestObjectError`), enabling blind SSRF capabilities. |
| 2026-11-01 NEW 2026 | Tandoor Recipes XXE local file read via lxml and SSRF in importer intermediate 1 min read SSRF XXE | Library advisory detailing two vulnerabilities in Tandoor Recipes' import subsystem. The first is an XML External Entity (XXE) vulnerability in the `rezeptsuitede` and `Cookmate` XML importers, exploitable with `lxml`'s default parser to read local files like `.env`. The second is a Server-Side Request Forgery (SSRF) in the pestle importer, an incomplete fix of GHSA-j6xg-85mh-qqf7, due to unhindered `requests.get` calls. |
| 2026-10-31 NEW 2026 | H7CTF 2026 Merged: Jinja2 SSTI filter bypass intermediate SSTI | Writeup detailing a Jinja2 Server-Side Template Injection (SSTI) filter bypass technique from H7CTF 2026. The challenge involved a certificate design interface rendering user input via Jinja2. After confirming SSTI with {{7*7}}, the author bypassed a naive safety filter blocking underscores by constructing them via ASCII codes to achieve RCE and subsequently retrieve the flag from `/flag.txt` using `os.popen`. |
| 2026-10-31 NEW 2026 | Serena RCE via insecure pickle deserialization of LSP symbol cache intermediate 5 min read AI Deser RCE Supply Chain | Library for analyzing Serena RCE via insecure pickle deserialization of LSP symbol cache. A malicious repository can execute arbitrary code on project activation by shipping a poisoned `document_symbols.pkl` file. This vulnerability, CWE-502, affects `serena-agent` versions up to 1.7.1 and leverages Python's `pickle.load` during language server initialization, bypassing trust settings and leading to command execution as the user running Serena. |
| 2026-10-31 NEW 2026 | Xoscar unauthenticated RCE through actor message deserialization intermediate 4 min read AI Deser RCE | Library for securing Xoscar actor message deserialization, addressing unauthenticated remote code execution vulnerabilities. Versions up to v0.11.2 and v0.12.0 with an unset `XOSCAR_AUTH_KEY` are affected, allowing arbitrary Python code execution through `cloudpickle.loads` in actor pool processes. Version v0.12.0 introduces opt-in message authentication via `XOSCAR_AUTH_KEY` to mitigate these risks, which also covers control-plane exposure like `get_config` and `stop` commands. |
| 2026-10-31 NEW 2026 | Server-Side Template Injection to RCE in a Lab intermediate 11 min read RCE SSTI | Walkthrough of Server-Side Template Injection (SSTI) leading to Remote Code Execution (RCE) on a lab environment. This resource details how to identify SSTI by detecting template engine evaluation via mathematical probes, differentiate between engines like Jinja2 and Freemarker, and exploit the Jinja2 object model to access sensitive configuration like `SECRET_KEY`. It further demonstrates traversing Python's runtime to locate objects for command execution, culminating in an RCE. The guide also briefly covers defensive measures and uses the tool `tplmap` for confirmation. |
| 2026-10-31 NEW 2026 | ZDI-26-816 Ultralytics load_dataset_cache_file deserialization RCE intermediate AI Deser RCE | Writeup of ZDI-26-816, a deserialization of untrusted data remote code execution vulnerability in Ultralytics' `load_dataset_cache_file` function. Successful exploitation requires user interaction and allows remote attackers to execute arbitrary code within the context of the current user by leveraging improper validation of user-supplied data. The primary mitigation is to restrict interaction with the affected product. → zerodayinitiative.com |
| 2026-10-26 2026 | Breaking the AWS MCP Python Sandbox advanced 10 min read AI RCE | Library for bypassing Python sandbox restrictions in AWS's `aws___run_script` tool, enabling command execution within the AWS Lambda environment. The research details how to circumvent AST validation and runtime restrictions by exploiting Python 3.10's structural pattern matching. This technique allows access to sensitive attributes, including `__class__` and `__reduce_ex__`, by dynamically constructing attribute names using `chr()` and reassigning `__match_args__` on `namedtuple` subclasses. |
| 2026-10-24 2026 | Evolving Threat: http2shell is an RCE in Node, Python, and more news RCE | The "http2shell" vulnerability is a critical remote code execution (RCE) flaw affecting Node.js, Python, and other programming environments. This exploit allows attackers to gain unauthorized control of affected systems by manipulating HTTP/2 requests. The discovery highlights a significant evolving threat landscape, emphasizing the need for developers and organizations to promptly patch their applications and servers to mitigate the risk of compromise. |
| 2026-09-09 2026 | Compromised Flutter package on pub.dev contains XCSSET malware news 7 min read Supply Chain | Library analyzing a variant of XCSSET malware discovered within the `universal_file_viewer` Flutter package on pub.dev. This macOS worm infects Android Gradle projects, Xcode projects, and Git repositories by injecting malicious build hooks and pre-commit hooks. The malware's propagation modules, `android_finder`, `git_finder`, and `replicator_finder`, aim to spread infection to other developers. Persistence is achieved by impersonating the Launchpad tile in the Dock, and various theft modules target credentials from browsers, Notes, and clipboard data. → aikido.dev |
| 2026-08-19 2026 | Benchmarking Secure-and-Functional Remediation and How Snyk Agent Fix Lifts Frontier-Model Fix Rates by over 14% news 9 min read | Library for benchmarking secure-and-functional vulnerability remediation, evaluating frontier models like Gemini 3.1 Pro and Claude Opus 4.6. Snyk Agent Fix, augmented with Snyk Intelligence, demonstrably lifts fix rates by over 14%, improving performance from 74.6% to 85.4% for Opus 4.6. This enhancement is most pronounced in areas where models struggle, such as Python samples, where Snyk Intelligence boosts fixes from 64% to 88%. → snyk.io |
| 2026-08-11 2026 | Python Software Foundation - Python 3.11.0a3 to 3.15.0b2 news 12 min read RCE | Writeup 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 2026 | Flaws in Google APK for Python Unlock Agent-to-Agent Attack intermediate | This 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 2026 | How I Found a High-Severity Directory Traversal in Flask-Admin intermediate 4 min read RCE | Library 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 2026 | Leaking internal headers in Flask Ninja with deserialization intermediate 5 min read Deser | Writeup 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 2026 | HN Security - My Semgrep C/C++ ruleset is ready for prime time again intermediate 5 min read Secrets | Library 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 2026 | Shipping post-quantum cryptography to Python intermediate 4 min read | Library 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 2026 | BadHost - One character and your AI agent switches sides intermediate 3 min read | Writeup 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 2026 | Taming our Python dependencies at Microsoft with AI intermediate 9 min read | Tool, 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 2026 | Hunting Leaked PyPI Tokens: 62 Live, 125 Packages Exposed intermediate 4 min read Secrets Supply Chain | Analysis 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 2026 | File encryption in Python: An in-depth exploration of symmetric and asymmetric techniques intermediate 7 min read | Library 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 2026 | Code injection in Python: examples and prevention intermediate 7 min read RCE | Library 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 2026 | Command injection in Python: examples and prevention intermediate 10 min read RCE | Library 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 2026 | Mastering Python virtual environments: A complete guide to venv, Docker, and securing your code intermediate 6 min read | Library 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 2026 | Understanding and mitigating the Jinja2 XSS vulnerability (CVE-2024-22195) intermediate 3 min read XSS | Writeup 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 2026 | The ultimate guide to creating a secure Python package beginner 14 min read | Guide 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 2026 | Symmetric vs. asymmetric encryption: Practical Python examples beginner 14 min read | Library 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 2026 | How to secure Python Flask applications intermediate 14 min read API Sec | Library 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 2026 | Ultralytics AI Library Hacked via GitHub for Cryptomining intermediate 4 min read Supply Chain | Library 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 2026 | Three’s a Crowd: TeamPCP trojanizes LiteLLM in Continuation of Campaign news 3 min read Secrets Supply Chain | Writeup 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 2026 | Snyk and uv, Better Together intermediate 3 min read AI | Library 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 |
| Browse all 244 Python resources → | ||
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.