$ tollbar review --gate major
tollbar · uncommitted changes · 4 files, +212 −9exampleejemplo
3 serious problems: don’t ship this.2 serious problems: don’t ship this.1 serious problem: don’t ship this.No problems found.
src/checkout.ts
- 1import Stripe from "stripe";
- 2import { pay } from "stripe-easy-checkout";
The package "stripe-easy-checkout" doesn’t exist on npm
Typical AI mistake · src/checkout.ts:2 · rule phantom-import
The code imports a package that doesn’t exist. It usually happens when the AI invents a name. It’s dangerous: someone can publish a package with that name and ship malicious code (it’s called slopsquatting).
src/orders.ts
- 12app.get("/orders/:id", auth, async (req, res) => {
- 13 // load the order
- 14 const order = await db.orders.find(req.params.id);
- 15 res.json(order);
Any logged-in user can open someone else’s order.
[CRITICAL] Security · src/orders.ts:14 · AI
Nothing checks that the order belongs to the person asking. Change the number in the address and you see another customer’s.
Fix: Check that the order belongs to the logged-in user before returning it.
src/refunds.ts
- 31const amount = validateRefund(order, body.amount);
- 32await stripe.refunds.create({ charge, amount });
The refund amount is never checked.
[MAJOR] Bug · src/refunds.ts:32 · AI
It is, one line up. Not a real problem: dropped.
AI: claude-cli (sonnet) · 3 calls · 14k input tokens · 1 dropped · 21.3 sAI: claude-cli (sonnet) · 2 calls · 11k input tokens · 14.9 sno AI (rules only) · 0.4 s