{"record":{"id":"f13053297ea7d80c","repo":"affaan-m/ECC","slug":"invalid-recipient","errorCode":null,"errorMessage":"Invalid recipient","messagePattern":"Invalid recipient","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"skills/security-review/SKILL.md","lineNumber":376,"sourceCode":"  try {\n    const isValid = verify(\n      Buffer.from(message),\n      Buffer.from(signature, 'base64'),\n      Buffer.from(publicKey, 'base64')\n    )\n    return isValid\n  } catch (error) {\n    return false\n  }\n}\n```\n\n#### Transaction Verification\n```typescript\nasync function verifyTransaction(transaction: Transaction) {\n  // Verify recipient\n  if (transaction.to !== expectedRecipient) {\n    throw new Error('Invalid recipient')\n  }\n\n  // Verify amount\n  if (transaction.amount > maxAmount) {\n    throw new Error('Amount exceeds limit')\n  }\n\n  // Verify user has sufficient balance\n  const balance = await getBalance(transaction.from)\n  if (balance < transaction.amount) {\n    throw new Error('Insufficient balance')\n  }\n\n  return true\n}\n```\n\n#### Verification Steps","sourceCodeStart":358,"sourceCodeEnd":394,"githubUrl":"https://github.com/affaan-m/ECC/blob/d8409a4b0813771235555e32e3d8046a73988bfa/skills/security-review/SKILL.md#L358-L394","documentation":"Illustrative Solana/web3 check from the security-review skill: verifyTransaction compares transaction.to against the expected recipient and throws when they differ. It guards against a substituted destination address before any balance or signing steps run.","triggerScenarios":"Thrown at skills/security-review/SKILL.md:376 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Derive the recipient from a trusted config rather than user input","Re-verify the recipient immediately before signing","Halt the pipeline and alert on any recipient mismatch"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d8409a4b0813771235555e32e3d8046a73988bfa","analyzedAt":"2026-08-26T12:15:34.022Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}