Skip to content

Fix OS command injection in ForkCurl consumer#246

Merged
MichaelGHSeg merged 1 commit intomasterfrom
SECOPS-24014
Mar 11, 2026
Merged

Fix OS command injection in ForkCurl consumer#246
MichaelGHSeg merged 1 commit intomasterfrom
SECOPS-24014

Conversation

@MichaelGHSeg
Copy link
Contributor

@MichaelGHSeg MichaelGHSeg commented Mar 11, 2026

Summary

  • Security fix: The ForkCurl consumer interpolated user-controlled context.library.name and context.library.version values directly into a shell command passed to exec(), enabling arbitrary OS command injection.
  • Applied escapeshellarg() to the User-Agent header and URL arguments, consistent with how $payload and $secret are already escaped.
  • No functional change for normal inputs — escapeshellarg() produces identical output for values without shell metacharacters.

Test plan

  • Verified escapeshellarg() output is identical to old manual quoting for standard library values (analytics-php/3.8.1)
  • Verified malicious input ('; id>&2 #) is properly neutralized
  • Run full CI test suite to confirm no regressions

🤖 Generated with Claude Code

The User-Agent header values (library name and version) from message
context were interpolated directly into a shell command without escaping,
allowing arbitrary command execution. Apply escapeshellarg() to the
User-Agent header and URL, consistent with how payload and secret are
already handled.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@MichaelGHSeg MichaelGHSeg merged commit 2b4aa68 into master Mar 11, 2026
36 checks passed
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.

2 participants