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

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.

Start here: the Python learning pathAn ordered route through this library — orientation, then methodology, then research. 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. Python on the appsec.fyi WikiInterlinked reference pages — techniques, variants, and defenses, one concept per page.
Date Added Link Excerpt
2026-11-25 NEW 2026DeepSpeed _get_zero_stage deserialization of untrusted data RCE advanced AI Deser RCELibrary vulnerability GHSA-8gj7-wpcq-235c in DeepSpeed allows Remote Code Execution via deserialization of untrusted checkpoint data. Attackers can exploit this flaw, which arises from improper validation during data parsing, to execute arbitrary code within the affected process's context, requiring user interaction to trigger. This vulnerability was also identified as ZDI-CAN-29242.
2026-11-25 NEW 2026PyTorch torch_save_to_dcp deserialization of untrusted data RCE advanced AI Deser RCELibrary for identifying and mitigating PyTorch deserialization vulnerabilities like GHSA-3rc2-9x43-cg72. This vulnerability in `torch_save_to_dcp` permits remote attackers to execute arbitrary code through specially crafted malicious pages or files. The flaw stems from inadequate validation of user-supplied data during checkpoint format conversion, enabling code execution within the user's context.
2026-11-25 NEW 2026Reconic: automated recon orchestrating Subfinder, Katana, Nuclei and httpx intermediate 5 min read Bug Bounty ReconLibrary for orchestrating reconnaissance tools like Subfinder, Katana, Nuclei, and httpx. Reconic manages the workflow, handles scope, tracks changes between runs, and provides notifications for new findings. It allows for passive enumeration, active scanning, and scheduled monitoring, with detailed reporting of discovered hosts, endpoints, and vulnerabilities, and supports custom headers and proxy configurations.
2026-11-25 NEW 2026PyTorch PT2 file parsing code injection RCE advanced AI RCELibrary for PyTorch PT2 file parsing, addressing a code injection RCE vulnerability (GHSA-9hqx-6m26-fqj3). This flaw stems from insufficient validation of user-supplied strings during PT2 file parsing, enabling remote attackers to execute arbitrary Python code within the affected process. The vulnerability, previously identified as ZDI-CAN-32602, requires interaction with the library for exploitation, with attack vectors varying by implementation.
2026-11-25 NEW 2026Microsoft's agent-framework on PyPI was hijacked: what to check news 16 min read Secrets Supply ChainWriteup of the Microsoft agent-framework PyPI hijacking detailing the credential stealer introduced in versions 1.26.1 and 1.26.2. The malicious code, hidden in a `.pth` file, executed on Python startup, exfiltrating environment variables containing secrets, other process environments, credential files, and new Azure/GitHub OIDC tokens. Detection methods focus on searching lockfiles, the filesystem for malicious files, and CI logs for dependency installations within the affected timeframe.
2026-11-25 NEW 2026Microsoft agent-framework compromised twice on PyPI news 7 min read AI Secrets Supply ChainLibrary releases of Microsoft’s agent-framework on PyPI were compromised twice, stealing credentials from environment variables and files, and exfiltrating Azure DevOps, Azure managed identity, and GitHub Actions tokens. The malicious packages, versions 1.26.1 and 1.26.2, exploited a `.pth` file to execute a stealer script upon Python startup, even without direct package import. This attack vector was similar to a previous incident involving the durabletask package, with the second agent-framework compromise potentially involving stolen ESRP client certificates and private keys.
2026-11-25 NEW 2026LiteLLM pass-through endpoint code injection RCE intermediate AI RCELibrary for addressing GHSA-hq8p-44jw-2jhm, a LiteLLM pass-through endpoint code injection RCE. This vulnerability, authenticated and identified as ZDI-CAN-31433, allows remote attackers to execute arbitrary code by exploiting improper validation during module import within the `pass_through_endpoints` functionality. Successful exploitation leads to code execution in the context of the service account.
2026-11-25 NEW 2026Pyro ParamStoreDict.load insecure deserialization (GHSA-5xrx-2cmv-7g72) intermediate AI DeserAdvisory for GHSA-5xrx-2cmv-7g72 details an insecure deserialization vulnerability in Pyro versions up to 1.9.2, specifically within the ParamStoreDict.load() function. This flaw arises from the use of torch.load with weights_only=False, allowing for the unpickling of arbitrary Python objects. Attackers can exploit this by tricking users into loading a malicious parameter file, potentially enabling arbitrary code execution with the privileges of the Python process.
2026-11-24 NEW 2026Seventeen days after the letters: npm and PyPI malware feeds, measured again news 12 min read Supply ChainSurvey of npm and PyPI malware feed accuracy, re-measuring packages seventeen days after initial notifications. This analysis tracks registry actions, identifies errors in automated scanners like Amazon Inspector and OpenSSF, and highlights new techniques for temporary package placeholders. It also details specific instances where PyPI and npm failed to act on flagged malicious packages and examines the self-correction capabilities of feeds like Vulnetix.
2026-11-24 NEW 2026Malicious code in instantscrape (PyPI) news Supply ChainAdvisory for malicious code in instantscrape (PyPI), GHSA-wqr9-48cj-55gj. This campaign, 2026-11-instantscrape, involves an infostealer that executes an embedded malicious executable during installation or import. The package overrides the `install` command in `setup.py` to facilitate this malicious activity, leading to file exfiltration. Obfuscation techniques are also employed.
2026-11-24 NEW 2026We caught the agent-framework PyPI compromise six minutes after it published news 7 min read AI Secrets Supply ChainLibrary detecting a PyPI compromise of the agent-framework package, versions 1.26.1 and 1.26.2, which stole Azure, Azure DevOps, and GitHub Actions tokens via a .pth startup hook. The malicious package extracts environment variables, credential files (including Azure CLI token caches, pip/npm configs, Docker configs, Hugging Face tokens), Azure DevOps OIDC tokens, and Azure Instance Metadata Service tokens. Data is exfiltrated to a webhook after zlib compression and Base64 encoding.
2026-11-24 NEW 2026USN-9177-1: PyJWT non-canonical signature vulnerability news JWTAdvisory for USN-9177-1 detailing a PyJWT vulnerability where non-canonical signature encodings were accepted, potentially allowing attackers to bypass token revocation checks. This issue impacts systems running affected versions of PyJWT and requires updating to corrected package versions to mitigate the risk.
2026-11-23 NEW 2026BentoML: SSTI via unsandboxed Jinja2 in Dockerfile generation intermediate 3 min read RCE SSTI Supply ChainLibrary that prevents Server-Side Template Injection (SSTI) via unsandboxed Jinja2 in BentoML's Dockerfile generation. This vulnerability, identified in GHSA-v959-cwq9-7hr6, allows arbitrary host code execution when importing malicious bento archives due to the use of `jinja2.ext.do` and `jinja2.ext.debug` extensions in an unsandboxed `jinja2.Environment`. The fix involves replacing the vulnerable `Environment` with `jinja2.sandbox.SandboxedEnvironment` and removing dangerous extensions.
2026-11-23 NEW 2026lxml: default iterparse()/ETCompatXMLParser() allows XXE to local files intermediate XXELibrary vulnerability GHSA-vfmq-68hx-4jfw in lxml's default `iterparse()` and `ETCompatXMLParser()` configurations permits XXE attacks to read local files. This is mitigated by upgrading to lxml 6.1, which sets `resolve_entities` to `'internal'` by default, or by manually setting `resolve_entities='internal'` or `resolve_entities=False` when using older versions.
2026-11-23 NEW 2026Loading a Dataset Should Not Run Code intermediate 1 min read Deser RCEWriteup detailing CVE-2026-132751 in the yt data analysis toolkit, where loading a saved ytdata file with malicious `con_args` executed arbitrary code via `eval()`. This vulnerability, a type of CWE-95 (Improper Neutralization of Special Elements used in an Evaluated Expression), allowed attackers to achieve remote code execution by crafting an HDF5 file whose saved parameters contained a Python payload. The flaw resided in the `_parse_parameter_file()` function, which directly passed user-supplied `con_args` to `eval()`, turning dataset loading into code execution.
2026-11-23 NEW 2026How to Prevent Prompt Injection in Python LLM Apps: 6 Layers That Actually Help intermediate 7 min read AILibrary for layering Python defenses against prompt injection in LLM applications. It demonstrates six techniques including separating instructions from untrusted data, treating retrieved documents and tool output as data, enforcing least privilege for tools with argument validation via pydantic, checking output for prompt leaks or exfiltration vectors, and employing a basic input screen for known suspicious phrases. Code snippets are provided for Python 3.13.5, targeting OWASP's LLM01 vulnerability.
2026-11-23 NEW 2026Microsoft’s AI Agent Package Was Hijacked on PyPI: Here’s How to Check If You’re Affected news 5 min read AI Supply ChainWriteup of a PyPI compromise targeting Microsoft's agent-framework package, versions 1.26.1 and 1.26.2, which contained a credential stealer. The malware executed via `.pth` files during Python startup, targeting Azure, AWS, and GitHub tokens. The article details methods for checking affected systems, rotating credentials, and hardening development environments through version pinning with hashes, careful adoption of new releases, limiting CI job permissions, restricting outbound traffic, and separating environments.
2026-11-23 NEW 2026The Credential Was Valid. The Publisher Was Not. news 9 min read AI Supply ChainLibrary for securing applications, detailing the compromise of Microsoft's agent-framework package on PyPI. This malicious package, versions 1.26.1 and 1.26.2, released on 17 November 2026, contained code that exfiltrated cloud and CI credentials, including Azure CLI, npm, pip, Git, Docker, Hugging Face, and Azure DevOps credentials, along with Azure managed-identity and GitHub Actions OIDC tokens. The attack utilized a .pth file to ensure the payload ran on Python interpreter startup. Analysis of the attacker's webhook.site drop point revealed the use of the Cairn AI penetration-testing framework and pointed to a potential compromise of Microsoft's ESRP client certificate and private key. The incident highlights supply chain risks and the importance of publisher verification, even when credentials appear valid, as evidenced by PyPA advisory PYSEC-2026–4388 and GitHub Advisory GHSA-764m-3ppc-5m73.
2026-11-23 NEW 2026FortiPy: SSTI to root writeup intermediate RCE SSTIThis writeup details a successful exploit chain on FortiPy, a Python framework often used in enterprise environments. The process involved a Server-Side Template Injection (SSTI) vulnerability, which allowed for initial code execution. This was then escalated to achieve root privileges on the underlying system. The writeup likely provides a step-by-step breakdown of how the SSTI was discovered and leveraged to gain full control.
2026-11-22 NEW 2026Arize Phoenix CVE-2026-53998: GraphQL format-string secrets leak news 6 min read AI GraphQL SecretsAdvisory for CVE-2026-53998 details a critical format string injection vulnerability in the Arize Phoenix AI observability platform. Versions 13.0.0 through 15.7.0 (excluding 15.7.0) are affected, allowing an unauthenticated attacker via the `applyChatTemplate` GraphQL query to access environment variables and secrets like `PHOENIX_SECRET`. This can lead to session token forgery and decryption of stored credentials, including LLM API keys. The fix involves upgrading to version 15.7.0 and rotating exposed secrets and keys.
2026-11-22 NEW 2026PyPI's redesigned project pages with clearer security signals are now live news 5 min read Supply ChainLibrary updates on PyPI's project pages now highlight security signals, including release provenance states and per-file attestations. These improvements, guided by the OpenSSF Attestations Style Guide, clarify package origins with "Full Provenance" (verifying 100% of files via PyPI Publish or SLSA Build attestations) and "No Provenance" indicators. Warnings are also surfaced for unusual or conflicting metadata, prompting users to investigate potential account takeovers or compromised build pipelines. The redesigned interface features a dedicated security tab and updated project detail, release files, and release history views to aid users in assessing package security.
2026-11-22 NEW 2026Frappe ERPNext SQL injection news SQLiFrappe ERPNext versions 7.0.0 through 15.122.0 and 16.x before 16... are vulnerable to SQL injection attacks. This vulnerability could allow attackers to execute arbitrary SQL commands, potentially compromising data integrity and security. Users are advised to update to the latest versions to patch this security flaw.
2026-11-22 NEW 2026Frappe ERPNext SQL injection (4.3.0 to 15.121.6) news SQLiA SQL injection vulnerability exists in Frappe ERPNext versions 4.3.0 through 15.121.6. The flaw also affects versions 16.x prior to version 16. This vulnerability could allow an attacker to execute arbitrary SQL commands by exploiting a weakness in how the application handles user input. This could lead to data breaches or system compromise. Users are strongly advised to update to patched versions immediately.
2026-11-22 NEW 2026Frappe insecure direct object reference news AuthZ IDORFrappe versions prior to 16.30.0 have a vulnerability allowing insecure direct object references (IDOR). This flaw enables unauthorized users to access or manipulate data they should not have permissions for. Exploiting this could lead to data breaches or system compromises. Users are strongly advised to update to Frappe 16.30.0 or later to mitigate this security risk.
2026-11-22 NEW 2026pydantic-ai SSRF guard misses Tencent Cloud metadata (169.254.0.23) news AI SSRFAdvisory for GHSA-5fj9-5pjw-vpwc details a Server-Side Request Forgery (SSRF) vulnerability in `pydantic-ai`'s cloud-metadata guard. The blocklist failed to prevent fetching credentials from Tencent Cloud's instance metadata service at `169.254.0.23` when local URLs were permitted via `force_download='allow-local'` or `web_fetch_tool(allow_local_urls=True)`. Exploitation allows an attacker to retrieve temporary role credentials by supplying a URL that points to the metadata endpoint. Mitigation involves upgrading to a patched version, disabling local URL fetching on Tencent Cloud, or network-level blocking of `169.254.0.23`.
2026-11-22 NEW 2026OpenShot Video Editor (openshot-qt) unsafe deserialization news DeserOpenShot Video Editor (openshot-qt) versions up to 4.1.1 are vulnerable to unsafe deserialization. This vulnerability allows attackers to execute arbitrary code on a victim's system by crafting a malicious project file. When the vulnerable version of OpenShot opens this file, it deserializes the untrusted data, leading to code execution. This could enable attackers to compromise the user's system.
2026-11-22 NEW 2026python-jose JWT forgery with an empty HMAC key (CVE-2026-120459) news 10 min read AuthN JWTLibrary for python-jose that details CVE-2026-120459, a critical vulnerability affecting all releases through 3.5.0. The flaw allows an attacker to forge JWTs by providing an empty HMAC key during signature verification, leading to unauthorized access and privilege escalation. Affected applications are those using python-jose with HS256, HS384, or HS512 algorithms where the verification key can resolve to an empty string, empty bytes, or an empty JWK 'k' parameter. Mitigation involves rejecting empty keys and considering migration to libraries like PyJWT 2.15.1, which enforces non-empty HMAC keys.
2026-11-22 NEW 2026CPython 0-days threaten the AI supply chain (Jinja model-template sandbox escape) advanced 8 min read AI SSTI Supply ChainLibrary for exploiting CPython 0-day vulnerabilities that threaten the AI supply chain, specifically focusing on a Jinja model-template sandbox escape. This library details how memory-safety flaws in CPython, particularly abuses of generic type handling, can lead to arbitrary code execution within LLM inference engines. The exploit leverages out-of-bounds reads and manipulates tuple hashing to recover crucial Python objects like `str`, `type`, and `code`, ultimately enabling the execution of malicious code through a backdoored chat template.
2026-11-22 NEW 2026Poet writeup: LFI to forged cookie to Jinja2 SSTI RCE intermediate 5 min read RCE SSTILibrary detailing a Linux machine walkthrough, starting with LFI on a Flask Note Library app via the `note` parameter. This allows for retrieval of the `SECRET` environment variable and the application's source code, revealing an admin panel secured by a forged `auth` cookie. Exploiting Jinja2 SSTI on the admin panel leads to remote code execution and a reverse shell as the `william` user. Privilege escalation is achieved using a custom SUID binary, `poet-fetch`, to write a new root user entry to `/etc/passwd`, ultimately granting a root shell.
2026-11-22 NEW 2026HackSmarter Casino walkthrough: leaked source-map API to Flask SSTI intermediate 4 min read Recon SSTIWalkthrough detailing the compromise of the "Hack Smarter World" luxury resort's Linux box. This writeup covers exploiting a leaked JS source map to discover a hidden API, which then reveals valid guest credentials. The subsequent Server-Side Template Injection (SSTI) in the profile page leads to code execution, and a chain of sloppy file permissions and exposed credentials in logs and shell history ultimately grants root access.
2026-11-21 NEW 2026Pwn for fun: path traversal bypass using NFKD in sanitize-filename on PyPI intermediate RCEA path traversal vulnerability has been discovered in the `sanitize-filename` Python package on PyPI. The vulnerability, dubbed "Pwn for fun," can be bypassed using NFKD (Compatibility Decomposition) encoding. This allows malicious actors to potentially access or modify files outside of intended directories. → yeswehack.com
2026-11-21 NEW 2026How to Handle Secrets in Python: Six Secure Patterns beginner 18 min read SecretsLibrary for secure Python secrets management, detailing six patterns to prevent credential leakage. It covers local development strategies like using `.env` files with `python-dotenv` and OS keychains with `keyring`, and production solutions such as AWS Secrets Manager, Google Cloud Secret Manager, Azure Key Vault, and HashiCorp Vault. The library also addresses secure token generation with the `secrets` module and emphasizes rotating credentials regularly, highlighting that over 64% of secrets remain valid past their rotation date. → blog.gitguardian.com
2026-11-21 NEW 2026Plug-and-Play Authentication with Keycloak in Python intermediate 5 min read AuthN JWTLibrary for seamless Keycloak authentication in Python applications, reducing integration code to approximately 80 lines. It encapsulates the OAuth 2.0 / OpenID Connect lifecycle, including authorization code flow with PKCE, state and nonce verification, issuer validation, token refreshing, and RP-initiated logout. The connector handles discovery documents, caches signing keys (JWKS), and validates JWTs, enabling secure SSO with minimal boilerplate by delegating identity and access management to Keycloak.
2026-11-21 NEW 2026How to Handle Secrets in Python: Six Secure Patterns intermediate 18 min read SecretsLibrary for Python secrets management, detailing six secure patterns including `.env` files with `python-dotenv`, JSON configuration, and environment variables, as well as advanced techniques using OS keychains with `keyring`, cloud services like AWS Secrets Manager and Google Cloud Secret Manager, and HashiCorp Vault. It emphasizes preventing hardcoded credentials in Git, using Pydantic's `SecretStr`, and rotating secrets regularly, especially given 28.65 million new secrets were found in public GitHub in 2025. → blog.gitguardian.com
2026-11-21 NEW 2026Attackers Compromise Microsoft's Agent Framework PyPI Package to Steal Cloud Credentials news 3 min read AI Supply ChainLibrary compromise: Malicious versions of Microsoft's `agent-framework` (1.26.1, 1.26.2) on PyPI were found to contain credential stealers. These versions inject `.pth` files that execute on every Python start, exfiltrating environment variables, cloud identity tokens (including Azure CLI, Azure DevOps OIDC, and Azure IMDS), and other credentials to a `webhook[.]site` endpoint. This attack highlights risks to AI developer ecosystems and CI pipelines, following a previous compromise of Microsoft's `durabletask` package. → thehackernews.com
2026-11-21 NEW 2026audio-separator insecure deserialization news DeserWriteup of CVE-2026-134172 in audio-separator, detailing an insecure deserialization vulnerability present before version 0.47.2. Attackers can achieve remote code execution by providing malicious Demucs .th model files loaded via torch.load with weights_only=False. This vulnerability is exploitable by local users writing to shared model directories or attackers controlling unverified model download sources when Demucs separation is initiated.
2026-11-21 NEW 2026ROS 2 sros2 load_policy XXE information disclosure news XXELibrary update addressing GHSA-2hcx-2grf-9jf2, an XML External Entity (XXE) information disclosure vulnerability in Open Robotics ROS 2's `sros2 load_policy` function. This flaw, also tracked as ZDI-CAN-32121, allows remote attackers to expose sensitive information by tricking users into opening a specially crafted XML policy file. The vulnerability stems from insufficient restrictions on XML External Entity references during policy file parsing.
2026-11-21 NEW 2026Arize Phoenix CVE-2026-53998: one unauthenticated GraphQL query reads os.environ via f-string template news 7 min read AI GraphQL Secrets SSTILibrary with CVE-2026-53998 vulnerability in `arize-phoenix` PyPI package, versions >= 13.0.0 and < 15.7.0, allows unauthenticated remote attackers to read sensitive environment variables, including `PHOENIX_SECRET`, via a crafted GraphQL query to the `applyChatTemplate` function. This f-string template rendering vulnerability enables attackers to forge admin sessions and decrypt stored secrets like LLM provider API keys. The fix hardens the template formatter to prevent attribute traversal starting with underscores. → corgea.com
2026-11-21 NEW 2026Flyto2 Core: SSRF guard validates resolved IP but connects by hostname news 2 min read SSRFLibrary advisory for Flyto2 Core versions <= 2.26.6 details a Server-Side Request Forgery (SSRF) vulnerability. The `validate_url_ssrf` function resolves a hostname, validates its IP against private ranges, but then discards the IP, returning only the hostname. This creates a race condition where a controlled DNS can first resolve to a public IP for validation, then resolve to an internal IP at connect time, bypassing the SSRF guard. This allows attackers to fetch sensitive internal resources.
2026-11-21 NEW 2026pretix-adyen stored XSS news XSSA stored cross-site scripting (XSS) vulnerability has been found in the pretix-adyen payment plugin. The flaw allows an attacker to inject malicious scripts, which are then stored and executed within the application. This could lead to unauthorized actions or data theft for users interacting with the compromised pretix-adyen instance.
2026-11-20 NEW 2026Nautobot: sensitive field disclosure via Jinja2 attribute lookups intermediate 2 min read Secrets SSTIAdvisory on Nautobot's sensitive field disclosure vulnerability in Jinja2 templates, an incomplete fix for GHSA-8f2w-54mq-66gg and GHSA-5q66-3x3p-rxmh. The vulnerability allows low-privileged users to access REST API token keys and password hashes of other users, including administrators, via custom links or other user-authored templates by exploiting attribute lookups not subject to sensitive_fields control. This can lead to account takeover. Patches are available in Nautobot v2.4.46+ & v3.2.9+.
2026-11-20 NEW 2026Microsoft’s Agent Framework PyPI package compromised to steal credentials news 2 min read AI Supply ChainLibrary compromise involving Microsoft's Agent Framework on PyPI saw malicious versions 1.26.1 and 1.26.2 released, designed to steal cloud credentials from Azure, AWS, GitHub, Docker, Hugging Face, and OpenAI. Discovered by Socket, Step Security, and Ox Security, these versions exploited Python startup to exfiltrate sensitive data, including Azure and GitHub OIDC tokens. Developers who installed these versions are advised to isolate systems, rotate credentials, and rebuild from clean environments. → bleepingcomputer.com
2026-11-20 NEW 2026NVIDIA Megatron-LM checkpoint loading deserialization intermediate AI DeserNVIDIA Megatron-LM has a deserialization vulnerability in its checkpoint loading feature. This flaw allows an attacker to execute arbitrary code by supplying a maliciously crafted checkpoint file. The vulnerability arises from improper handling of serialized data. This could lead to unauthorized access and control over systems using Megatron-LM.
2026-11-20 NEW 2026NLTK AllowlistUnpickler doesn't deny numpy file-I/O sinks intermediate 4 min read DeserLibrary for secure pickle deserialization in NLTK, specifically addressing vulnerabilities in `nltk.picklesec.allowlisted_pickle_load`. This library identifies and mitigates an issue where `numpy`'s file I/O functions, such as `numpy.lib._npyio_impl.recfromtxt` (arbitrary file read) and `numpy.lib.format.open_memmap` (arbitrary file creation), were not properly denylisted. The fix involves denying entire `numpy.lib` prefixes and tightening the allowed globals list for `TransitionParser` models, preventing unauthorized file access.
2026-11-20 NEW 2026social-core: login CSRF in SAML callbacks via RelayState intermediate 1 min read AuthN CSRFLibrary advisory for social-auth-core detailing a login CSRF vulnerability (GHSA-4pv2-52v7-vrfx) in its SAML callback functionality. The issue impacts applications using the SAML backend with session-restoring strategies, allowing an attacker to log in a victim's browser as themselves by manipulating unsigned RelayState. The vulnerability stems from improper correlation of SAML responses with the initiating browser's session. Affected versions range from 4.7.0 through 6.2.0.
2026-11-20 NEW 2026webrecon-cli: DNS, subdomain, HTTP, TLS and port recon scanner beginner 5 min read ReconTool for web reconnaissance, `webrecon-cli` offers asynchronous DNS enumeration, subdomain discovery, HTTP fingerprinting, technology detection, TLS certificate inspection, and TCP port scanning. It provides JSON, terminal, and HTML reports with features like rate limiting, explicit scope enforcement, and content discovery that avoids soft 404s. The tool supports custom wordlists, flexible output formatting, and secure handling of sensitive report data. → pypi.org
2026-11-20 NEW 2026Flyto2 Core: SSRF guard bypass via DNS rebinding intermediate 4 min read SSRFLibrary for hardening against SSRF vulnerabilities, specifically detailing a bypass of `validate_url_ssrf` in `flyto-core` via DNS rebinding. This technique exploits the `resolve-then-connect` pattern, where the application checks a public IP for a hostname but then connects to a private IP after the attacker controls DNS resolution. The vulnerability, classified as CWE-918 and CWE-367, affects multiple modules within `flyto-core` and builds upon previously addressed SSRF issues by highlighting the need to pin resolved IP addresses rather than just validating hostnames.
2026-11-20 NEW 2026django-docutils unsafe defaults: local file disclosure, SSRF and stored XSS intermediate 3 min read SSRF XSSLibrary advisories detail vulnerabilities in `django-docutils` versions prior to 0.30.0, allowing local file disclosure, server-side requests (SSRF), and stored cross-site scripting (XSS) through unsafe Docutils directive processing. Exploitable via attacker-controlled reStructuredText (RST) in fields like comments or profile text, these issues stem from Docutils' default behavior for file insertion and raw HTML directives. The fix in 0.30.0 disables these features by default and sanitizes doctrees.
2026-11-19 2026Microsoft agent-framework PyPI Package Compromised news 8 min read Supply ChainLibrary versions 1.26.1 and 1.26.2 of Microsoft's agent-framework package on PyPI were compromised with credential-stealing malware. The payload, delivered via .pth startup hooks, harvests environment variables, credential files, and scrapes other processes' environments. It also attempts to mint identity tokens from GitHub Actions OIDC, Azure DevOps OIDC, and Azure managed identity endpoints, exfiltrating data to a webhook. The attacker demonstrated rapid re-publication after the initial quarantine. → stepsecurity.io
2026-11-19 2026Microsoft’s agent-framework PyPI package Compromised with Credential Stealer news 3 min read AI Supply ChainLibrary that, when compromised in agent-framework versions 1.26.1 and 1.26.2, utilizes Python `.pth` startup hooks to exfiltrate Azure, GitHub Actions, and CI/CD credentials. The malicious code silently harvests environment variables, cloud identity tokens, and configuration files, then transmits them to a webhook.site endpoint. → socket.dev

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.