[spark-compete] fix(security): require approval for user and group account mutations#1441
Open
mrxlolcat wants to merge 1 commit into
Open
Conversation
Commands that create, modify, or delete local user accounts and groups (adduser, useradd, usermod, userdel, deluser, groupadd, groupmod, groupdel, passwd, chpasswd) were not classified by the approval classifier, so they returned requires_approval=False. An agent that can run these commands can backdoor a host by adding a new account, promoting an existing user to sudo, or resetting a password — all identity-level mutations that warrant operator review. Classify the full set as identity_access_mutation/high and add tests covering each command. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Spark Compete Packet
{ "schema": "spark-compete-hotfix-v1", "event": "spark-compete-first-event", "submission_mode": "public_repo_pr", "submission_target_url": "https://github.com/vibeforge1111/spark-cli/pull/1441", "team": { "name": "lolcat", "members": [ "mrxlolcat", "ouwibo", "rahmanhsim" ], "llm_device_holder": "mrxlolcat", "device_holder_github": "https://github.com/mrxlolcat", "github_accounts": [ "mrxlolcat", "ouwibo", "rahmanhsim" ] }, "target_repo": { "id": "vibeforge1111/spark-cli", "source": "https://github.com/vibeforge1111/spark-cli", "owner_surface": "spark-cli" }, "issue": { "type": "security_concern", "severity": "high", "title": "User and group account management commands bypass the approval classifier", "actual_behavior": "approval_required_for_command(['adduser', 'alice']) returns requires_approval=False. Same for useradd, usermod, userdel, deluser, groupadd, groupmod, groupdel, passwd, chpasswd. An agent can create backdoor accounts or promote users to sudo without operator approval.", "expected_behavior": "All user and group account mutations should be classified as identity_access_mutation/high and require operator approval.", "repro_steps": [ "from spark_cli.security.approval import approval_required_for_command, CommandContext", "d = approval_required_for_command(['adduser', 'alice'], CommandContext())", "assert d.requires_approval == False # BUG: should be True", "d = approval_required_for_command(['usermod', '-aG', 'sudo', 'alice'], CommandContext())", "assert d.requires_approval == False # BUG: should be True" ], "affected_workflow": "Any agent with shell access \u2014 can add malicious users, elevate privileges, or reset passwords without operator review" }, "evidence": { "safe_links_only": true, "before_after_proof": "Before: adduser/useradd/usermod/userdel/deluser/groupadd/groupmod/groupdel/passwd/chpasswd fall through to catch-all, returns requires_approval=False. After: all classified as identity_access_mutation/high, requires_approval=True.", "links": [ "https://github.com/vibeforge1111/spark-cli/pull/1441" ], "forbidden": [ "pdf", "zip", "exe", "unknown downloads", "shortened links", "archives", "binaries", "tokens", "browser cookies", "wallet material", "raw logs", "raw conversations", "raw memory", "raw patches", "private repo maps", "private scoring details" ] }, "proposed_fix": { "approach": "Add a single classifier branch matching adduser, useradd, usermod, userdel, deluser, groupadd, groupmod, groupdel, passwd, chpasswd \u2014 classify all as identity_access_mutation/high.", "files_expected": [ "src/spark_cli/security/approval.py", "tests/test_cli.py" ], "tests_or_smoke": "New test test_approval_classifier_flags_user_account_mutations covers all 10 commands as subtests. python -m pytest tests/test_cli.py -k 'user_account' -> 1 passed, 10 subtests passed." }, "pr": { "branch": "fix/user-account-mutation-approval", "title_prefix": "[spark-compete]", "author_github": "mrxlolcat", "body_must_include": [ "packet", "team", "pr_author", "repo", "actual_behavior", "expected_behavior", "repro_steps", "before_after_proof", "tests_or_smoke", "duplicate_notes", "risk_notes", "review_claim" ], "url": "https://github.com/vibeforge1111/spark-cli/pull/1441" }, "review_claim": { "impact_claim": "high", "evidence_types": [ "passing_test" ], "duplicate_notes": "Checked all open spark-compete PRs. No existing PR covers adduser, useradd, usermod, userdel, deluser, groupadd, groupmod, groupdel, passwd, or chpasswd in the approval classifier.", "risk_notes": "Only src/spark_cli/security/approval.py and tests/test_cli.py modified. No CI, dependency, installer, or auth changes. Adds classification branches only \u2014 no existing approved flows broken.", "review_state_requested": "pr_review" } }PR Author: mrxlolcat