ENGINEERING RESOURCE
Verify each vulnerability in your staging environment before deploying to production.
AI assistants frequently create API route handlers that query records by an ID parameter without verifying that the requesting session owns the tenant or record.
// Vulnerable: trusts client-provided ID
export async function GET(req: Request, { params }: { params: { id: string } }) {
const doc = await db.document.findUnique({ where: { id: params.id } });
return NextResponse.json(doc);
}// Hardened: scopes query strictly to authenticated user's organization
export async function GET(req: Request, { params }: { params: { id: string } }) {
const session = await requireAuth();
const doc = await db.document.findFirst({
where: { id: params.id, organizationId: session.orgId },
});
if (!doc) return NextResponse.json({ error: "Not found" }, { status: 404 });
return NextResponse.json(doc);
}In Next.js, referencing API keys inside client components or using `NEXT_PUBLIC_` prefixes causes sensitive tokens (OpenAI, Stripe secret keys, Resend tokens) to be baked into public JS chunks.
Prototypes often deserialize JSON bodies directly into ORM queries without Zod or Pydantic validation, leaving databases open to mass assignment.
Free or standard AI prototype templates omit IP or user rate limits, enabling attackers to exhaust OpenAI/Anthropic API budgets or brute-force accounts.
Passing unsanitized user inputs directly into tool execution arguments enables prompt injection to trigger unauthorized actions.
AI-generated schemas frequently rely purely on application-level checks without defining explicit DB constraints or composite indexes.
Quick-fix boilerplates commonly set `Access-Control-Allow-Origin: *` with credentials enabled.
Webhook dispatchers or image fetchers accepting arbitrary user URLs can be exploited to probe internal cloud metadata services (e.g. 169.254.169.254).
Startups often cannot trace who updated financial data, deleted records, or altered permissions.
AI coding tools occasionally import packages that don't exist, which threat actors squat on public registries (package hallucination attack).
We deliver a comprehensive 1-week code audit with prioritized fixes, pull requests, and automated regression testing.