{
  "id": "RHB-SAMPLE-001",
  "rule": "CWE-89",
  "file": "src/api/products.ts:6",
  "branch": "rehabilty/fix-product-query",
  "query": "SELECT * FROM products WHERE category = ?",
  "payload": "books' OR '1'='1",
  "before": "const query = `SELECT * FROM products WHERE category = '${category}'`;\nconst products = await database.query(query);",
  "after": "const query = 'SELECT * FROM products WHERE category = ?';\nconst products = await database.query(query, [category]);",
  "checks": [
    {
      "id": "sql-injection",
      "input": "books' OR '1'='1",
      "expectedRows": 0
    },
    {
      "id": "normal-category",
      "input": "books",
      "expectedRows": 1
    },
    {
      "id": "quoted-category",
      "input": "kids' books",
      "expectedRows": 1
    },
    {
      "id": "unknown-category",
      "input": "missing",
      "expectedRows": 0
    }
  ],
  "kind": "reproducible-sample",
  "environment": "Node.js / SQLite / isolated in-memory fixture",
  "reproducedBefore": {
    "returnedRows": 3,
    "expectedRows": 0
  },
  "tests": [
    {
      "id": "sql-injection",
      "input": "books' OR '1'='1",
      "expectedRows": 0,
      "actualRows": 0,
      "status": "passed"
    },
    {
      "id": "normal-category",
      "input": "books",
      "expectedRows": 1,
      "actualRows": 1,
      "status": "passed"
    },
    {
      "id": "quoted-category",
      "input": "kids' books",
      "expectedRows": 1,
      "actualRows": 1,
      "status": "passed"
    },
    {
      "id": "unknown-category",
      "input": "missing",
      "expectedRows": 0,
      "actualRows": 0,
      "status": "passed"
    }
  ],
  "branchStatus": "proposed-example-only",
  "limitations": "Checks validate this SQL query repair only. No customer repository was scanned and no remote branch was created."
}
