Skip to content

Fix Patrol finding: patrol-input-denylist-blocks-ld-preload-but-a7992e117a - #1237

Open
ivankuznetsov wants to merge 1 commit into
mainfrom
hive/patrol-fix/patrol-input-denylist-blocks-ld-preload-but-a7992e117a/g1
Open

Fix Patrol finding: patrol-input-denylist-blocks-ld-preload-but-a7992e117a#1237
ivankuznetsov wants to merge 1 commit into
mainfrom
hive/patrol-fix/patrol-input-denylist-blocks-ld-preload-but-a7992e117a/g1

Conversation

@ivankuznetsov

Copy link
Copy Markdown
Owner

Patrol Fix

This pull request repairs one finding tracked by Hive's Patrol Fix workflow.

Sources

  • ordinary_patrol: architecture-lib-hive-workflow-package-part-2-20260817T060428Z-d05d49fb-1

Finding evidence

  • {"file":"lib/hive/workflow_package/input_name.rb","line":10,"snippet":"LD_LIBRARY_PATH LD_PRELOAD","role":"root_cause"}
  • {"file":"lib/hive/workflow_package/input_name.rb","line":15,"snippet":"DYLD_","role":"root_cause"}
  • {"file":"lib/hive/workflow_package/input_name.rb","line":26,"snippet":"RESERVED_PREFIXES.any? { |prefix| name.start_with?(prefix) }","role":"trigger"}
  • {"file":"lib/hive/workflow_package/runtime_policy.rb","line":56,"snippet":"child_environment[name] = value","role":"impact"}

Independent review

The exact patch closes the reported Linux loader environment gap by reserving the complete LD_ namespace through the existing shared input-name boundary. The broad validation failure is confined to unchanged agent-cli-runtime executable resolution and reproduces independently, while changed-boundary tests and lint pass.

  • The clean worktree HEAD is exactly d66041b, based on b07b869, with changes limited to input_name.rb and validator_test.rb.
  • InputName.valid? now rejects the LD_ prefix family, including LD_AUDIT, LD_ASSUME_KERNEL, LD_DEBUG_OUTPUT, LD_LIBRARY_PATH, LD_PRELOAD, and LD_PROFILE, while still accepting GSC_ACCESS_TOKEN.
  • Focused validation passed: validator_test.rb 18 runs and 113 assertions; configuration_test.rb 18 runs and 64 assertions; source_snapshot_test.rb 11 runs and 47 assertions.
  • The controller broad-suite failure at components/agent-cli-runtime/test/runtime_test.rb:114 was reproduced independently and that component is unchanged by this patch; it reflects local grok executable resolution rather than the input-name change.
  • RuboCop inspected both changed files with no offenses, and git diff --check reported no whitespace errors.

Validation

Verdict: failed

  • ordinary:test: exit 1
  • agent:focused-validator-regression-suite: exit 0
  • agent:ld-family-rejection-check: exit 0
  • agent:fix-commit-present-on-branch: exit 0

Optional workflow input names only rejected LD_LIBRARY_PATH and
LD_PRELOAD individually, so other Linux dynamic-linker control surfaces
such as LD_AUDIT, LD_PROFILE, and LD_DEBUG_OUTPUT passed InputName.valid?
and reached managed child environments. Mirror the existing DYLD_ prefix
guard with an LD_ prefix in RESERVED_PREFIXES and add a regression test
covering the Linux loader env family.
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