Bugs Veld caught
this week.
Not demos. Not toy examples. This is what the engine flags in real codebases — with the diff, the explanation, and the fix. Want this on yours? Install Veld →
Want to see Veld running live on a real repo? Live demo →
TOCTOU race in balance check
Veld flagged this. Two concurrent requests both pass the balance check before either deduction runs. Result: funds spent twice. The fix collapses read-check-write into a single atomic UPDATE with a WHERE guard — no window for a second request to slip through.
Admin route missing authentication middleware
Veld flagged this. `GET /admin/users` returned the full user table — no session check, no role check, nothing. The `requireAdmin` middleware already existed in the codebase. It just wasn't applied here. One line, full data exposure closed.
Off-by-one drops last page of results
Veld flagged this. With 25 items and page_size=10, `25 // 10` returns 2 — the third page silently vanishes. Any list whose length isn't a clean multiple loses its tail. `ceil` fixes it in one character.
Hardcoded credentials committed to repo
Veld flagged this. Production credentials in source = credentials in every clone, fork, and CI log. Rotate immediately, then use environment variables. Git history will still contain the old value — consider that credential compromised regardless.
Business logic embedded in HTTP controller
Veld flagged this. Pricing, tax calculation, and order limits live inside the HTTP handler. That logic can't be tested without spinning up Express, and it can't be reused from a background job or CLI. Controllers translate HTTP — that's it. Move the business rules into a service layer.
Want this on your repo?
Set up takes under 2 minutes. No Slack message required.
Install on a repo →
Veld flagged this. User-controlled input is concatenated directly into a SQL string. An attacker sends `' OR 1=1 --` and reads every row. Parameterized queries make injection structurally impossible — the driver handles escaping, not your code.