snapcart-api
Monorepo checkout, auth, and inventory API for the Snapcart marketplace demo. Last analyzed 2 min ago.
Findings summary
Score breakdown
76
Improved by fix
81
Based on detected findings
72
Regression tests added
91
Based on detected findings
88
Based on detected findings
Issues
Sensitive Data in Error Responses
src/middleware/error.ts:9
Unhandled exceptions bubble up raw stack traces and internal query shapes to the API client, leaking schema details and potentially sensitive values.
Potential SQL Injection
src/api/users.ts:42
User-controlled input is being interpolated directly into a SQL query string. An attacker who controls the query parameter could alter the query's logic and read, modify, or delete data they should not have access to.
Missing Input Validation
src/api/profile.ts:18
The profile update handler trusts the request body without checking types, lengths, or allowed fields, so malformed or oversized payloads are processed as-is.
Unsanitized HTML Rendered
src/client/review.ts:31
Client review comments are injected into the DOM via innerHTML without sanitization, creating a stored XSS channel.
Open Redirect in Callback
src/api/auth/callback.ts:64
The OAuth callback forwards users to a URL provided in the query string without host validation, allowing phishing links that start on a trusted domain.
Unhandled Promise Rejection
src/api/webhooks/order.ts:87
The order webhook handler fires an async processing task without attaching a rejection handler, so failures drop silently into the void.
Disabled Lint Rule on Bundle-Critical File
src/analytics/track.ts:12
eslint-disable blocks three warnings in the analytics script, including a no-unused-vars condition hiding what looks like a dead branch.
Outbound Requests Without Timeout
src/client/throttle.ts:21
External API calls are never given a timeout, so a hanging third-party service can pin Node workers indefinitely until they exhaust the process pool.
Duplicated Price Logic
src/services/invoice.ts:41
Discount computation is copied across checkout and invoice modules and has already drifted by a rounding rule in one of them.
Unbounded Batch Query
src/api/export.ts:55
The export endpoint reads every row matching a filter into memory in a single query, which grows without bound as sales data accumulates.
Webhook Delivery Has No Retry
src/services/events.ts:57
A webhook whose first delivery fails is dropped, so downstream services can miss inventory and fulfillment events permanently.
Missing Error Handling
src/services/payment.ts:73
The payment capture call is not wrapped in a try/catch and its failure is treated as success by the caller, so charge failures can silently mark orders as paid.
Unsafe `any` Propagation
src/services/inventory.ts:102
A terse cast is used to silence a type mismatch, and the resulting any silently passes through three layers of the inventory service.
Service Account Env Fallback
lib/config.ts:3
A development service account lives in a committed env fallback used when CI lacks real credentials.
Magic Number in Retry Window
src/services/retry.ts:8
A bare 30000 appears in the retry scheduler with no explanation of what it represents.
Unused Export
src/utils/format.ts:17
`formatSlug` is exported but never imported, so tree-shaking keeps it and its helper bundle.
Decorative Images Missing Alt
src/admin/hero.tsx:44
Marketing images are rendered without alt text, failing non-text contrast and screen-reader guidance.
- Uploaddone
- Analyzedone
- Findactive
- Explainupcoming
- Fixupcoming
- Testupcoming
- Verifyupcoming