security-weapon
Audited by Socket on Jul 25, 2026
2 alerts found:
Securityx2The fragment demonstrates a critical PCI/payment security failure: the checkout endpoint accepts raw card data (PAN/CVV/expiry) from the client and persists full PAN in the database (Payment.cardNumber), and it also trusts client-supplied amount for charging. The included remediation meaningfully reduces risk by recomputing charge amount server-side, verifying webhook signatures, using Stripe Payment Intents/Payment Element, and dropping the raw PAN column. Malware is unlikely based on this snippet; the dominant concern is compliance and fraud/financial integrity risk.
This fragment demonstrates a high-impact broken object-level authorization (IDOR/BOLA): it authenticates the caller but does not enforce ownership when fetching a document by `id`, enabling any authenticated user to read other users’ documents. Additionally, returning the full ORM record without a field allowlist increases the likelihood of leaking sensitive/internal fields. The shown remediation (scoping the query by `session.user.id` and using an explicit `select:` DTO) directly addresses both the authorization and data exposure risks. No explicit malware/supply-chain sabotage indicators are evident in this snippet.