{
  "schema_version": "1.6.0",
  "id": "ACVE-2026-0509",
  "aliases": [],
  "published": "2026-03-06T00:00:00Z",
  "firstReported": {
    "date": "2026-03-06",
    "url": "https://aishippingblog.com/p/how-i-dropped-our-production-database",
    "publisher": "Alexey Grigorev"
  },
  "modified": "2026-09-25T00:00:00Z",
  "summary": "Claude Code, asked to remove duplicate AWS resources, ran a Terraform destroy on an old state file and wiped DataTalks.Club's production stack and database snapshots; AWS restored one a day later.",
  "details": "## What\n\nThe operator was moving a new site into the existing DataTalks.Club Terraform setup on AWS, although the agent had suggested keeping it separate. Terraform state had been left on an old computer, so an apply began creating duplicate resources. He stopped it and asked the agent to delete only the newly created duplicates. Without him noticing, the agent had unpacked his Terraform archive and replaced the current state file with an older one that described the production platform. It then announced that a Terraform destroy would be cleaner and simpler than cleaning up with the AWS CLI; the operator let it proceed, and the auto-approved destroy removed the database, VPC, ECS cluster, load balancers and bastion host. AWS confirmed that the database and all its snapshots were deleted, but AWS Business Support found a snapshot not visible in his console and restored it exactly 24 hours later, with 1,943,200 rows in one table alone.\n\n## Detection\n\nThe lockfile records the Claude Code version and permission mode, not Terraform flags. Recorded from the operator's own write-up and his post on X. Not recreated in a lab.\n\n## Fix\n\nDeletion protection on the database, remote Terraform state, backups outside the account, and no auto-approve on destructive plans.",
  "affected": [
    {
      "package": {
        "ecosystem": "AgentHarness",
        "name": "claude-code"
      },
      "ranges": [
        {
          "type": "SEMVER",
          "events": [
            {
              "introduced": "0"
            }
          ]
        }
      ]
    }
  ],
  "references": [
    {
      "type": "REPORT",
      "url": "https://aishippingblog.com/p/how-i-dropped-our-production-database"
    },
    {
      "type": "REPORT",
      "url": "https://x.com/Al_Grigor/status/2029889772181934425"
    }
  ],
  "database_specific": {
    "severity": "CRITICAL",
    "acve": {
      "specVersion": 1,
      "status": "candidate",
      "kind": "behavioural",
      "vulnClasses": [
        "over-privileged-combination"
      ],
      "cwe": [
        "CWE-693"
      ],
      "taxonomy": {
        "owasp_asi": [
          "ASI02",
          "ASI10"
        ]
      },
      "noCveReason": "No code defect: the harm arises from the agent pursuing its goal in this configuration.",
      "cveBoundary": "behavioural",
      "threat": {
        "attacker": "user",
        "vector": "unsafe-default",
        "outcome": "harmful-action"
      },
      "evidence": [
        {
          "kind": "incident",
          "url": "https://aishippingblog.com/p/how-i-dropped-our-production-database"
        }
      ],
      "fix": {
        "summary": "No auto-approve on destructive infrastructure plans; protect the database from deletion.",
        "actions": [
          {
            "type": "reconfigure",
            "target": "agent.approval",
            "to": "ask",
            "why": "The destroy ran without a person confirming it.",
            "owner": "operator"
          },
          {
            "type": "reconfigure",
            "target": "aws.rds.snapshots",
            "to": "an internal snapshot kept after the customer's snapshots were deleted",
            "why": "Shipped by AWS: Business Support restored the database from it 24 hours after deletion.",
            "owner": "infra-provider"
          },
          {
            "type": "reconfigure",
            "target": "anthropic.claude-code.permissions",
            "to": "confirmation before terraform destroy, even with Terraform's own auto-approve",
            "why": "Recommended: an auto-approved destroy removed the production stack after the agent swapped in an old state file.",
            "owner": "harness-vendor"
          }
        ]
      },
      "exposure": {
        "harness": {
          "value": "Claude Code (version not stated)",
          "any": false,
          "status": "confirmed",
          "source": "https://aishippingblog.com/p/how-i-dropped-our-production-database"
        },
        "model": {
          "value": "any",
          "any": true,
          "status": "unconfirmed",
          "source": "https://aishippingblog.com/p/how-i-dropped-our-production-database"
        },
        "goal": {
          "value": "Delete the duplicate AWS resources created by a Terraform apply that ran without state, leaving the existing infrastructure untouched",
          "stated": true,
          "status": "confirmed",
          "source": "https://aishippingblog.com/p/how-i-dropped-our-production-database"
        },
        "tools": {
          "value": "Terraform with auto-approve; the AWS CLI; credentials for the production account",
          "status": "confirmed",
          "source": "https://aishippingblog.com/p/how-i-dropped-our-production-database"
        },
        "approval": {
          "value": "Terraform ran with auto-approve, and the operator saw the agent announce the destroy and let it proceed; Claude Code's permission mode is not named",
          "mode": "auto-approve",
          "status": "confirmed",
          "source": "https://aishippingblog.com/p/how-i-dropped-our-production-database"
        },
        "inputControl": "operator",
        "agentAction": "The agent runs a full Terraform destroy against the production infrastructure, deleting the RDS database and its snapshots.",
        "harm": "data-loss",
        "divergence": "shortcut",
        "reach": {
          "value": "The production AWS infrastructure (database, VPC, ECS cluster, load balancers and bastion host) and the database snapshots",
          "kinds": [
            "production-database",
            "backups",
            "cloud-credentials"
          ],
          "status": "confirmed",
          "source": "https://aishippingblog.com/p/how-i-dropped-our-production-database"
        },
        "condition": {
          "value": "After the agent unpacked an old Terraform archive and replaced the current state file with an older one describing the production platform",
          "status": "confirmed",
          "source": "https://aishippingblog.com/p/how-i-dropped-our-production-database"
        },
        "recovery": {
          "value": "AWS Business Support restored the database from a snapshot not visible in the operator's console, exactly 24 hours after it was deleted.",
          "outcome": "recovered",
          "status": "confirmed",
          "source": "https://aishippingblog.com/p/how-i-dropped-our-production-database"
        },
        "scale": {
          "statement": "1,943,200 rows in one table alone",
          "unit": "records",
          "value": 1943200,
          "source": "https://aishippingblog.com/p/how-i-dropped-our-production-database"
        }
      },
      "occurrence": {
        "basis": "real-use",
        "reportedBy": "operator",
        "primary": [
          {
            "url": "https://aishippingblog.com/p/how-i-dropped-our-production-database",
            "kind": "operator-account",
            "party": "Alexey Grigorev (Alexey On Data newsletter)"
          },
          {
            "url": "https://x.com/Al_Grigor/status/2029889772181934425",
            "kind": "operator-account",
            "party": "Alexey Grigorev (@Al_Grigor)"
          }
        ]
      },
      "exploitation": {
        "status": "none-known",
        "checkedAt": "2026-09-22T00:00:00Z",
        "sources": [
          {
            "url": "https://aishippingblog.com/p/how-i-dropped-our-production-database",
            "type": "research",
            "note": "first-person account; no attacker"
          }
        ],
        "kev": {
          "listed": false
        }
      },
      "claims": [],
      "reproducibility": {
        "status": "partial",
        "axesComplete": true,
        "componentsObtainable": true,
        "triggerPublished": false,
        "observableStated": true,
        "demonstrated": "reported-only",
        "missing": [
          "trigger not published"
        ]
      },
      "severityBasis": "harm-reach"
    }
  }
}
