marketplace/bundles/pm-dev-python/skills/python-security/SKILL.md
Use when reviewing or hardening Python security — injection sinks (subprocess, eval/exec, unsafe deserialization, SQL), path-traversal prevention, and untrusted-input handling at stdlib boundaries. The focused Python security surface resolved via skills_by_profile.security; a thin pointer that delegates cross-cutting foundations upward to plan-marshall:persona-security-expert.
npx skillsauth add cuioss/plan-marshall python-securityInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
REFERENCE MODE: This skill provides reference material for Python security review and hardening. Load specific standards on-demand based on current task. Do not load all standards at once.
Execution mode: Reference library; load standards on-demand for Python security review and hardening tasks.
Prohibited actions:
subprocess with shell=True; use an argv listpickle.load/pickle.loads untrusted bytes, nor yaml.load without a safe loadereval/exec/compile externally-sourced strings; use ast.literal_eval for literalsConstraints:
Activate when:
shell=True, quoting when a shell is unavoidableyaml.safe_load/json over pickle/yaml.loadast.literal_eval over eval/execPath.resolve() / is_relative_toLoad progressively based on current task. Never load all standards at once.
Read: ../python-core/standards/python-core.md
Load the Security (path traversal) and Injection and Unsafe Deserialization (subprocess / pickle / yaml / eval / SQL) sections. These cover the secure-by-default sink choices at each stdlib boundary:
| Sink | Insecure | Secure |
|------|----------|--------|
| Subprocess | shell=True with interpolation | argv list (no shell), or shlex.quote when shell is unavoidable |
| Deserialization | pickle.loads, yaml.load | yaml.safe_load, json.loads |
| Dynamic execution | eval/exec/compile | ast.literal_eval |
| SQL | f-string interpolation | DB-API placeholder + params tuple |
| Path handling | unchecked user path | Path.resolve().is_relative_to(safe_base) |
| Surface | Home |
|---------|------|
| Injection sinks + path-traversal prevention | ../python-core/standards/python-core.md (Security / Injection sections) |
| Cross-cutting OWASP / STRIDE / trust-boundary / secure-design foundations | Skill: plan-marshall:persona-security-expert |
This skill is a thin pointer: the Python sink mechanics above are genuinely language-specific (how to apply the secure choice at each stdlib boundary), but the conceptual why lives in the centralized plan-marshall:persona-security-expert sub-documents. Load the matching foundation, then return here for the Python mechanics — there is no content duplication:
| Python mechanic (here) | Centralized foundation (there) |
|------------------------|-------------------------------|
| Why every stdlib boundary value is untrusted; allow-list, canonicalize-before-validate, fail-closed (the general architecture behind every sink and path check) | input-validation-trust-boundaries.md |
| The subprocess / SQL / eval sinks mapped to a recognized risk category (A03 Injection) | owasp-top-ten.md |
| Why deserializing untrusted bytes is dangerous before any value inspection (the pickle/yaml.load avoidance is the Python mechanic) | input-validation-trust-boundaries.md — Unsafe Deserialization sub-section |
| The principles behind secure-by-default sink choices (secure by default, fail securely, economy of mechanism) | secure-design-principles.md |
Note the deserialization sinks (pickle/yaml.load) also map to OWASP A08 Software and Data Integrity Failures — see owasp-top-ten.md.
plan-marshall:persona-security-expert — Cross-cutting security review identity and authoritative home for OWASP Top 10, STRIDE, secrets, secure logging, trust boundaries, authn/authz, and secure-design principlespm-dev-python:python-core — Core Python development standards (the security/injection sections referenced above live under its standards/ directory)pm-dev-python:pytest-testing — Property-based / adversarial testing of security-relevant codedevelopment
Domain-owned OpenRewrite log-line finding parser for the java-cui domain — parses the
development
Domain-owned OpenRewrite marker detection for the java-cui domain — scans Java/Kotlin sources for cui-rewrite TODO markers, categorizes them by recipe, and fails the gate on any detected marker
development
Operator control surface for the marshalld build server — enrol/drop a project in the machine-global registry (the opt-in enable signal and anti-laundering wall), manage the daemon lifecycle (start, stop, drain, status, install, upgrade) version-pinned to the verified bundle copy, and inspect the daemon's per-project interaction-audit log (read-only)
tools
The tiny build-consumption client for the marshalld build server — submit a build job, bounded long-poll for its result, ping the daemon identity, and preflight registry-plus-liveness in one call; consumption only, never provisioning or enrolment