hardening: move to argument array pattern for shell execution (#6854)#6855
Merged
TheWitness merged 10 commits intoCacti:developfrom Mar 24, 2026
Merged
Conversation
6b5e617 to
c6a73fa
Compare
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
TheWitness
previously approved these changes
Mar 23, 2026
Member
|
@somethingwithproof, Still failing php-cs-fixer texted. Might be from a different pull.
|
- Auto-fix php-cs-fixer issues in lib/rrd.php and lib/poller.php - Replace undefined cacti_redirect() with header()+exit in oauth2.php Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
somethingwithproof
added a commit
to somethingwithproof/cacti
that referenced
this pull request
Mar 24, 2026
- Revert lib/poller.php and lib/rrd.php arg-array changes (belong in PR Cacti#6855) - Remove ArgArrayHardeningTest.php (belongs in PR Cacti#6855) - Revert vendor/composer updates (should be a separate PR) Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
TheWitness
added a commit
that referenced
this pull request
Mar 24, 2026
* fix: shellcheck fixes, codespell config, and actionlint config - Add .github/actionlint.yaml with no-shellcheck to disable false positives in run: blocks - Update .codespell.cfg to skip third-party assets, themes, mock data; add intentional words to ignore list - Fix shellcheck issues in all shell scripts: quoting, egrep to grep -E, glob iteration, bare redirects, SIGKILL trap Does not touch workflow YAML files (handled in #6874). Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * hardening: move to argument array pattern for shell execution (#6854) * docs: update exec_background docblock for string|array param types Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * docs: add PHPDoc to __rrd_execute for PHPStan Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * fix: resolve php-cs-fixer formatting issues Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * revert: remove oauth2.php fix (moved to standalone PR #6886) Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * chore: remove files that belong in other PRs - Revert lib/poller.php and lib/rrd.php arg-array changes (belong in PR #6855) - Remove ArgArrayHardeningTest.php (belongs in PR #6855) - Revert vendor/composer updates (should be a separate PR) Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * chore: remove composer.lock from tracking Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> --------- Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> Co-authored-by: TheWitness <thewitness@cacti.net>
Member
TheWitness
approved these changes
Mar 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


This PR introduces a structural hardening change to the shell execution layer by allowing
__rrd_execute()andexec_background()to accept an array of arguments.When an array is provided, the function automatically applies
cacti_escapeshellarg()to each element and joins them with spaces. This provides a safe, idiomatic path for executing commands without risky string concatenation.Fixes #6854