vulns.co
/
GKData.io MCP and API Buy me a coffee

Python Software Foundation

Python subprocess: executable, argument, and interpreter boundaries

Python's documentation distinguishes the executable being launched, its arguments and any shell that interprets them. Python does not implicitly choose a shell, but Windows may launch batch files through one. The shlex reference limits its quoting guarantees to Unix shells, so quoting alone is not a portable way to handle different interpreters.

Open the referenceImplementation GuideReviewed 2026-10-03

How to use this reference

Editorial learning objective: distinguish preserving argument boundaries from authorizing their meaning. Review which executable and interpreter receive data, what actions the receiving program assigns to arguments, and whether those actions fit the intended authority. This resource supports conceptual design review, without execution recipes.

Before reading

  • Basic familiarity with processes, arguments, and operating-system differences.

Context and limits

  • Windows batch-file handling can involve shell parsing even when the application has not explicitly selected a shell. The runtime guidance for this case is conditional, not a universal recommendation to enable shell execution.
  • shlex quoting is not guaranteed correct for non-POSIX shells or Windows shells.
  • The authorization distinction is editorial synthesis, not a claim that these Python APIs enforce application policy.
  • No vulnerability finding, award, payload, reproduction sequence, or testing authorization is established.

Sources

  1. subprocess: Security ConsiderationsPython Software Foundation · reviewed 2026-10-03
  2. shlex.quote: Unix-shell portability warningPython Software Foundation · reviewed 2026-10-03

Record reviewed 2026-10-03. Snapshot af2809c308fc. Open the complete JSON contract.

Library synced 2026-11-18 · cases last reviewed 2026-10-05

af2809c308fc · JSON exports & schemas · CC BY 4.0 content / MIT software