Skip to content

feat(databases): Add databases run command for and isolated database CLI#118

Merged
pthurlow merged 10 commits into
mainfrom
feat/databases-run
May 29, 2026
Merged

feat(databases): Add databases run command for and isolated database CLI#118
pthurlow merged 10 commits into
mainfrom
feat/databases-run

Conversation

@pthurlow
Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread src/databases.rs
eprintln!("{} {}", "database:".dark_grey(), db_id);
eprintln!("{} {}", "workspace:".dark_grey(), workspace_id);

let status = std::process::Command::new(&cmd[0])
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential command injection via Command API - high severity
While Rust's Command API follows security best practices by avoiding direct shell evaluation, improper handling of user inputs can still introduce command injection risks. If unsanitized user-controlled data is passed to Command::arg() or similar functions, an attacker may manipulate arguments to execute unintended commands, potentially leading to privilege escalation or system compromise

Show fix

Remediation: Validate and sanitize user inputs, avoiding direct user-controlled arguments. Prefer passing structured data instead of raw strings, especially with format!, use safe argument parsing methods, and restrict allowed inputs through allowlists.

Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AikidoSec ignore: security/access is handled by API Tokens in request headers and not via CLI command access. Therefore there can be no privilege escalation via injected command arguments

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Based on your feedback, we ignored this issue because of the following reason:

security/access is handled by API Tokens in request headers and not via CLI command access. Therefore there can be no privilege escalation via injected command arguments

@sentry
Copy link
Copy Markdown

sentry Bot commented May 29, 2026

Codecov Report

❌ Patch coverage is 60.12658% with 126 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/database_session.rs 71.17% 49 Missing ⚠️
src/databases.rs 57.01% 49 Missing ⚠️
src/main.rs 8.69% 21 Missing ⚠️
src/api.rs 22.22% 7 Missing ⚠️

📢 Thoughts on this report? Let us know!

Comment thread src/databases.rs
Comment thread src/database_session.rs
Comment thread src/command.rs
Comment on lines +642 to +643
/// Description for the auto-created database (only used when --database is omitted)
#[arg(long)]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super nit: this user-facing flag is --description but databases create (line 571) uses --name for the same underlying JSON field — both end up serialized as "name" by create_database_request. Two different flag names for the same field on sibling subcommands will trip people up. Picking one (and aligning README/SKILL.md, which currently disagree about which is canonical) would be worth a follow-up. (not blocking)

claude[bot]
claude Bot previously approved these changes May 29, 2026
@pthurlow pthurlow merged commit db7c05d into main May 29, 2026
11 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.

1 participant