Skip to content
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

fix: properly quote parameters for vip wp #2184

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open

Conversation

sjinks
Copy link
Member

@sjinks sjinks commented Jan 8, 2025

Description

The way the parameters are quoted now is insecure and vulnerable to parameter injection.

This PR tries to fix this.

Because we don't care about shell expansion or redirection (WP CLI commands will be executed directly, not via a shell), we can simplify quoting by enclosing the parameter in double quotes and escaping all inner double quotes with a slash.

Related: Automattic/cron-control-runner#32

Pull request checklist

New release checklist

Steps to Test

TBD.

@sjinks sjinks self-assigned this Jan 8, 2025
Copy link
Contributor

github-actions bot commented Jan 8, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Files

Copy link

sonarqubecloud bot commented Jan 8, 2025

src/lib/cli/format.ts Dismissed Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant