Skip to content

Comments

Use list-based arguments in subprocess calls for better robustness#184

Merged
zxqfd555 merged 1 commit intopathwaycom:mainfrom
RinZ27:fix/harden-subprocess-calls
Feb 4, 2026
Merged

Use list-based arguments in subprocess calls for better robustness#184
zxqfd555 merged 1 commit intopathwaycom:mainfrom
RinZ27:fix/harden-subprocess-calls

Conversation

@RinZ27
Copy link
Contributor

@RinZ27 RinZ27 commented Feb 1, 2026

Introduction

I noticed some potential issues in how subprocesses are handled and decided to refactor them for better robustness.

Context

The current implementation uses shell=True and string interpolation in several places (CLI, Airbyte connectors), which can be problematic if user-supplied strings contain shell metacharacters. Switching to list-based arguments and shell=False is a more robust approach that avoids manual shell quoting.

How has this been tested?

I've verified the syntax with py_compile. The functional logic remains identical as this is a refactoring of the execution layer.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature or improvement (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project,
  • My change requires a change to the documentation,
  • I described the modification in the CHANGELOG.md file.

@CLAassistant
Copy link

CLAassistant commented Feb 1, 2026

CLA assistant check
All committers have signed the CLA.

@RinZ27 RinZ27 force-pushed the fix/harden-subprocess-calls branch from ef21c02 to 4935d8f Compare February 1, 2026 05:09
@RinZ27 RinZ27 changed the title Harden subprocess calls to prevent command injection Use list-based arguments in subprocess calls for better robustness Feb 1, 2026
…tion

Refactored several subprocess calls to use list-based arguments and shell=False. This prevents potential command injection vectors in the CLI and Airbyte connector runner by avoiding string interpolation of user-supplied values into shell commands.
@RinZ27 RinZ27 force-pushed the fix/harden-subprocess-calls branch from 4935d8f to 99cf289 Compare February 1, 2026 05:11
@zxqfd555 zxqfd555 self-assigned this Feb 2, 2026
@zxqfd555
Copy link
Collaborator

zxqfd555 commented Feb 4, 2026

Thank you for the input! Merging.

@zxqfd555 zxqfd555 merged commit 5d0b93e into pathwaycom:main Feb 4, 2026
8 checks passed
@RinZ27 RinZ27 deleted the fix/harden-subprocess-calls branch February 5, 2026 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants