Skip to content

Test tooling: harden subprocess and path handling in Ruby SDK and Azure DevOps scripts (KSM-1244) - #1138

Merged
maksimu merged 1 commit into
masterfrom
feature/KSM-1244-ruby-docker-test-shell-injection
Aug 31, 2026
Merged

maksimu merged 1 commit into
masterfrom
feature/KSM-1244-ruby-docker-test-shell-injection

Conversation

@stas-schaller

@stas-schaller stas-schaller commented Aug 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Ruby SDK: hardens how the Docker/integration test-runner scripts invoke subprocesses. Azure DevOps extension: hardens a path substitution in its test runner. Both are dev/CI tooling only, not shipped in a published artifact, so no version bump is needed for either component.

Changes

Maintenance

  • sdk/ruby/test/integration/docker_test_suite.rb, docker_multi_version_test.rb, and run_all_tests.rb: switched subprocess invocations from interpolated shell strings to array-form system()/IO.popen(), which pass each argument directly to the binary with no shell involved (KSM-1244)
  • integration/keeper_secrets_manager_azure_pipeline_extension/ksm-azure-devops-secrets-task/tests/run-tests.sh: quoted a command substitution in a docker run mount argument so it isn't word-split or glob-expanded (KSM-1244)

Testing

cd sdk/ruby
ruby -c test/integration/docker_test_suite.rb
ruby -c test/integration/docker_multi_version_test.rb
ruby -c test/integration/run_all_tests.rb
ruby test/integration/docker_test_suite.rb -h
ruby test/integration/run_all_tests.rb -h

cd ../../integration/keeper_secrets_manager_azure_pipeline_extension/ksm-azure-devops-secrets-task/tests
bash -n run-tests.sh

Breaking Changes

None.

Related Issues

  • Jira: KSM-1244

@stas-schaller stas-schaller changed the title fix(ruby): array-form system() in docker test suite to prevent shell injection Ruby SDK: use array-form system() in docker test suite to prevent shell injection (KSM-1244) Aug 26, 2026
@stas-schaller
stas-schaller force-pushed the feature/KSM-1244-ruby-docker-test-shell-injection branch from 8d9884e to cf12348 Compare August 31, 2026 16:21
@stas-schaller stas-schaller changed the title Ruby SDK: use array-form system() in docker test suite to prevent shell injection (KSM-1244) Ruby SDK: use array-form system() in Docker test scripts to prevent shell injection (KSM-1244) Aug 31, 2026
…244)

Ruby SDK's docker_test_suite.rb, docker_multi_version_test.rb, and
run_all_tests.rb interpolated build/run/cleanup values into
system()/backtick calls, which Ruby runs through /bin/sh -c. Switched
to array-form system() and IO.popen, which pass each argument directly
to the binary with no shell involved.

Azure DevOps extension's run-tests.sh passed an unquoted $(pwd) into
the docker run -v flag, letting word-splitting or glob expansion break
the mount argument on a path with a space or glob character. Quoted
the substitution.
@stas-schaller
stas-schaller force-pushed the feature/KSM-1244-ruby-docker-test-shell-injection branch from cf12348 to f5b9b82 Compare August 31, 2026 16:39
@stas-schaller stas-schaller changed the title Ruby SDK: use array-form system() in Docker test scripts to prevent shell injection (KSM-1244) Test harness hardening: fix shell/path injection in Ruby docker tests and Azure DevOps run-tests.sh (KSM-1244) Aug 31, 2026
@maksimu
maksimu merged commit 7570363 into master Aug 31, 2026
16 checks passed
@stas-schaller stas-schaller changed the title Test harness hardening: fix shell/path injection in Ruby docker tests and Azure DevOps run-tests.sh (KSM-1244) Test tooling: harden subprocess and path handling in Ruby SDK and Azure DevOps scripts (KSM-1244) Aug 31, 2026
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