-
Notifications
You must be signed in to change notification settings - Fork 9
Labels
squad:platformIssue to be handled by the Platform team.Issue to be handled by the Platform team.type:bug
Milestone
Description
📝 Provide detailed reproduction steps (if any)
- Execute an internal command with shell-like payload in arguments, for example:
const diff = require('./lib/commands/diff.js').default; diff.execute({ arguments: [ 'test; touch HACKED; #' ], toolOptions: { packages: '' }, repository: { directory: '' } });
- Observe whether payload fragments are interpreted by the shell.
✔️ Expected result
Internal mrgit commands treat user-provided arguments as literal Git arguments and do not execute shell fragments.
❌ Actual result
Historically, several internal commands built shell command strings and could execute injected shell fragments.
❓ Possible solution
Introduce a safe internal Git runner using argument vectors (spawn with shell: false) and migrate vulnerable commands (diff, push, checkout, close, commit, sync) to use it. Keep mrgit exec shell-powered by design and document it as trusted-input only.
Definition of done
- Internal Git execution path does not use shell interpolation for affected commands.
- Regression tests cover shell-like payloads for affected command arguments.
-
pnpm lintpasses. -
pnpm testpasses. - Changelog entry added.
References
- Historical context: Security Fix for RCE on "mrgit" - huntr.dev #123
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
squad:platformIssue to be handled by the Platform team.Issue to be handled by the Platform team.type:bug