﻿# How can inherited descriptors cross a subprocess access boundary?

A practical investigation of how can inherited descriptors cross a subprocess access boundary?, with explicit observations, control cases and evidence limits.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/field-security-subprocess-inherited-descriptor-authority/
Language: en

## The operational scenario

A model-preparation helper runs with a restricted working directory, yet it receives an already open file or socket from its parent. That handle can retain access outside the reviewed path inventory. Changing cwd does not revoke it. The review must follow process creation and descriptor transfer, because a pathname-only account can miss capabilities established before the child began executing its own code.

## The trust-boundary mechanism

Python documents close_fds and an explicit POSIX pass_fds set for subprocess execution. Its os guide distinguishes non-inheritable descriptors from fork inheritance: close-on-exec behavior does not imply that a fork-only child never receives the descriptor. Python-created descriptors are non-inheritable by default, but native libraries, explicit flags and standard streams require their actual configuration to be inspected rather than assumed.

## Define the control contract

Define which files, pipes and sockets the child needs, including its input, output and diagnostic streams. Preserve access mode and owner for every intentionally transferred handle. Distinguish fork creation from execution of a new program and record platform-specific behavior. A reviewed working directory is an execution context, not a file-access sandbox. Avoid passing broad directory or service sockets merely because a narrow helper needs one artifact.

## A step-by-step verification

First inventory relevant open descriptors before launching a disposable helper. Configure the supported inheritance boundary and explicit transfer set. Use harmless marker files and a private fixture socket to compare intended access with an intentionally unneeded inherited handle. Verify that the child can read the accepted input and publish the declared result while the negative control is unavailable. Retain stderr and exit outcomes for failures.

## Evidence required for acceptance

Evidence includes launcher configuration, process identity, handle purpose and observed access decisions. A control that only changes the child’s directory should not be accepted as revoking an existing open handle. Check standard-stream redirections for accidental sensitive input or destinations. Acceptance means the exercised child receives the declared transfer set and completes its task, with other relevant inherited authority absent under the tested launch path.

## Failure cases and limits

Descriptor control does not revoke access the child can independently open through its own permissions, and a cooperating child can still misuse intentionally broad handles. Long-lived workers also need lifecycle checks after helper restarts. This protocol launches no actual helper here. It identifies the inherited-authority part of least privilege without treating it as a complete process sandbox or claiming every library’s default is unsafe.

## Primary references and related reading

A child’s access inventory must include inherited open handles, not only visible filesystem paths. [Python subprocess file-descriptor inheritance](https://docs.python.org/3/library/subprocess.html); [Python descriptor flags and descriptor-relative operations](https://docs.python.org/3/library/os.html); [Linux execve program execution](https://man7.org/linux/man-pages/man2/execve.2.html).

The proposed investigation of subprocess inherited descriptor authority is a proposed control review; no live security test was executed. Related reading: [Continue MCP working directory determines relative resource paths](/journal/guide-continue-mcp-working-directory/); [Read-only container will not start: where to allow temporary and cache writes](/journal/read-only-container-writable-caches/).
