Skip to content

[spark-compete] fix(security): require approval for user and group account mutations#1441

Open
mrxlolcat wants to merge 1 commit into
vibeforge1111:masterfrom
mrxlolcat:fix/user-account-mutation-approval
Open

[spark-compete] fix(security): require approval for user and group account mutations#1441
mrxlolcat wants to merge 1 commit into
vibeforge1111:masterfrom
mrxlolcat:fix/user-account-mutation-approval

Conversation

@mrxlolcat

@mrxlolcat mrxlolcat commented Jun 8, 2026

Copy link
Copy Markdown

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

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>
@mrxlolcat mrxlolcat requested a review from vibeforge1111 as a code owner June 8, 2026 04:51
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