Skip to content

Fix: cmd_status: call crm_mon without shell (#1429) #1430

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 31, 2024

Conversation

nicholasyang2022
Copy link
Collaborator

crm status ... appends tail arguments to the crm_mon -1 without quoting or escaping. This is unsafe as they will be parsed as a shell command.

This patch changes how crmsh calls crm_mon. Arguments is passed as string arrays instead of shell cmdline.

Fixes #1429.

Copy link

codecov bot commented May 30, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 53.72%. Comparing base (c723009) to head (1fb36b5).

Files Patch % Lines
crmsh/cmd_status.py 80.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1430   +/-   ##
=======================================
  Coverage   53.72%   53.72%           
=======================================
  Files          80       80           
  Lines       24073    24073           
=======================================
  Hits        12934    12934           
  Misses      11139    11139           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@liangxin1300
Copy link
Collaborator

Thanks!

@liangxin1300 liangxin1300 merged commit c9a8378 into ClusterLabs:master May 31, 2024
30 checks passed
@nicholasyang2022 nicholasyang2022 deleted the fix-issue-1429 branch May 31, 2024 04:20
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.

crmsh - shell injection in cmd status
2 participants