Skip to content

fix(cli): CLI command injection via exec() in github.ts (CWE-78) #17350

@kvenux

Description

@kvenux

Bug Report

Description: packages/opencode/src/cli/cmd/github.ts:330-337 uses exec() with string interpolation to open URLs in the browser. Since exec() spawns a shell, any shell metacharacters in the URL would be interpreted, enabling OS command injection.
CWE: CWE-78
Severity: Medium (currently hardcoded URL, but pattern is unsafe if URL becomes dynamic)
Reproduction: See POC test in PR

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions