Skip to content

Ruby SDK: use array-form system() in docker test suite to prevent shell injection (KSM-1244) - #1138

Open
stas-schaller wants to merge 1 commit into
masterfrom
feature/KSM-1244-ruby-docker-test-shell-injection
Open

Ruby SDK: use array-form system() in docker test suite to prevent shell injection (KSM-1244)#1138
stas-schaller wants to merge 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
Contributor

Summary

Ruby SDK: fixes a shell-injection risk in the Docker test-matrix script by switching its system() calls to array form. test/ is excluded from the packaged gem (see spec.files in the gemspec), so this doesn't touch anything released to RubyGems and needs no version bump.

Changes

Fixed

  • docker_test_suite.rb's three system() calls (build, run, cleanup) interpolated dockerfile_path, image_name, and test_file into shell strings executed via /bin/sh -c. Switched to array-form system(), which passes each argument directly to the binary with no shell involved (KSM-1244)

Testing

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

Security Impact

Removes a shell-injection vector flagged by Datadog SAST (ruby-security/path-injection) in sdk/ruby/test/integration/docker_test_suite.rb. The script is dev/CI tooling only, not shipped in the published gem, so no runtime or customer-facing security boundary is affected.

Breaking Changes

None.

Related Issues

  • Jira: KSM-1244, VM-2708

…ell injection (KSM-1244)

docker_test_suite.rb interpolated dockerfile_path, image_name, and
test_file into single-string system() calls, which Ruby runs through
/bin/sh -c. Switching to the array form of system() passes each value
as a literal argv element with no shell involved.
@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
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.

1 participant