Worked example: RecallIQ at commit af423c9
181 scanner candidates became 11 confirmed candidates, 166 dropped matches and 4 checks needing runtime evidence.
RecallIQ is an MIT-licensed React and Supabase app whose README says “Built with Lovable.” This source review is pinned to af423c91f366551b001e4e6f76cda3039b881488, dated 12 July 2025. Reviewed 10 November 2026. The app was never run and its live deployment was not tested.
- Rules run
- 49
- Raw candidates
- 181
- Confirmed candidates
- 11
- Dropped candidates
- 166
- Withheld issues
- 4
The 11 confirmed candidates group into 3 issues. Manual review adds 13 issues: 9 published and 4 withheld. That gives 16 confirmed issues, with 12 published below. Candidate counts and issue counts are different units. 4 candidates still need runtime evidence.
1 access-control finding withheld for private disclosure to the author (Critical). 2 access-control findings withheld for private disclosure to the author (High). 1 payment finding withheld for private disclosure to the author (High). Details remain private; the author has not been contacted.
- High · Memory-derived AI content is copied into function logs24 / 64
24 / 64 Errors & observability · severity 2 × likelihood 4 × blast radius 3
supabase/functions/ai-enhance-memory/index.ts:111The enhancement handler logs the raw model response and parsed content, plus a description fragment. Search and insights handlers also log query or model output. Personal memory content can therefore be duplicated into operational logs with separate access and retention settings. This is a logging exposure, not a demonstrated public read path.
Fix and verification
High confidence: the raw-response log call is unconditional on the successful provider path; actual log retention and staff access are unknown.
Fix: Remove content-bearing logs. Record request IDs, stage, elapsed time and provider status instead. Set retention and restrict access to any existing logs containing memory content.
Verify: Submit a synthetic memory containing a unique harmless marker in staging. Successful and failed requests produce useful diagnostics without that marker in logs. Not run.
- High · A failed memory save keeps the credit deduction18 / 64
18 / 64 Data integrity · severity 3 × likelihood 3 × blast radius 2
src/hooks/useMemoriesWithCredits.ts:18AddMemory calls addMemoryWithCredits. The hook awaits deductCredits before attempting the memory insert in a separate request. A failed insert enters a catch that tells the user credits were deducted; there is no compensation. Retrying can charge again without creating the first memory.
Fix and verification
High confidence: the debit and memory insert are separate awaited calls, and the failure branch explicitly retains the debit.
Fix: Combine the database insert and credit ledger mutation into one server transaction with an operation ID. Include attachment completion or a durable recovery state where needed.
Verify: Fail the memory insert after an eligible debit. Persisted credits remain unchanged and a retry saves exactly one memory with one debit. Not run.
- High · AI work has no application spend reservation18 / 64
18 / 64 Rate limits & abuse · severity 2 × likelihood 3 × blast radius 3
supabase/functions/ai-generate-insights/index.ts:17The insights handler maps the supplied memory collection into a prompt and calls the provider. Output max_tokens is set, but input collection size, simultaneous work and total application spend have no reservation or budget in this code path. Even ordinary repeated use can consume a shared provider quota. Gateway/provider controls may reduce exposure.
Fix and verification
High confidence that code-local controls are absent; external quotas and current pricing are unknown. This is not a claim about unauthenticated reachability.
Fix: Bound request bytes and memory count. Reserve per-user and global provider budget atomically before work; release or settle the reservation after completion.
Verify: In staging, issue concurrent eligible requests near a small test budget. Total reserved/spent work stays within the cap and excess work is rejected before provider calls. Not run.
- Medium · Nine external fetches have no cancellation deadline12 / 64
12 / 64 Resilience · severity 2 × likelihood 3 × blast radius 2
supabase/functions/ai-generate-insights/index.ts:50The scanner matched nine fetch calls across chat, order creation, OCR and audio processing. Each handler was read: none passes an abort signal. A hung upstream occupies the handler until an external platform limit; maxAttempts in transcription does not bound a single pending fetch.
Fix and verification
High confidence: all nine matched fetch options were inspected; platform shutdown limits are external and do not supply a controlled cancellation path.
Fix: Set per-attempt AbortSignal deadlines within a total request budget. Handle cancellation and retry only safe transient operations within that budget.
Verify: Use a staging upstream that accepts a connection and never replies. Every path exits inside its declared budget and records a retryable failure. Not run.
- Medium · The memories list has no pagination12 / 64
12 / 64 Queries & performance · severity 2 × likelihood 3 × blast radius 2
fetchMemories requests every visible row and column, ordered by date, without a cursor or range. Dashboard filters and search consume the full client array. Large histories increase transfer/render work; a configured API row ceiling can silently make that array incomplete. Owner RLS exists; this is a collection-size issue.
Fix and verification
High confidence: the query and its full-array callers lack pagination; actual row counts and the configured API ceiling are unknown.
Fix: Fetch bounded pages with a stable date/id cursor, select only display fields, and move collection-wide search/filtering to bounded server queries.
Verify: Load a fixture larger than the API row ceiling. All pages remain reachable and the first screen fetches a bounded payload. Not run.
- Medium · Transcription waits and polls inside the request12 / 64
12 / 64 Resilience · severity 2 × likelihood 3 × blast radius 2
supabase/functions/process-audio-transcription/index.ts:81The handler retains the upload/transcription workflow while polling up to 60 times with five-second sleeps, plus fetch duration. A long job can outlast the request/runtime and leave provider work running without a durable local continuation.
Fix and verification
High confidence: the polling loop and sleeps execute inside the request; the deployed runtime limit and provider job durations are unknown.
Fix: Persist the provider job ID and attachment status, return a job response, and use a bounded retryable worker or authenticated completion callback.
Verify: Submit a slow staging job and restart the worker. The request returns promptly and one durable job eventually reaches completed or failed. Not run.
- Medium · The AI search error handler uses out-of-scope variables12 / 64
12 / 64 Errors & observability · severity 2 × likelihood 3 × blast radius 2
supabase/functions/ai-search-memories/index.ts:130query and memories are const bindings inside try. The sibling catch references them when the upstream fails. Those bindings are outside the catch scope, so the intended fallback throws instead of returning its JSON error response.
Fix and verification
High confidence: the try-block const bindings are lexically unavailable to its sibling catch; the target TypeScript was not compiled.
Fix: Keep validated fallback inputs in outer scope, or return a controlled error without fallback. Validate shape before invoking any fallback.
Verify: Force a provider 503 and malformed request separately. The handler returns controlled JSON with the intended status; no secondary ReferenceError occurs. Not run.
- Medium · Processing failure tries to consume the body twice12 / 64
12 / 64 Errors & observability · severity 2 × likelihood 3 × blast radius 2
supabase/functions/process-image-ocr/index.ts:122OCR already consumed req.json() at line 18. Its catch tries req.json() again before updating failed status; the consumed stream rejects and the inner catch only logs. Audio transcription repeats this pattern at line 157. Attachments can remain pending after processing fails.
Fix and verification
High confidence: both request bodies are consumed before the recovery branch attempts to read them again.
Fix: Parse once and retain the validated attachment ID outside try. Update failure state using that value; handle the update result and define a retry path.
Verify: Make OCR and audio providers fail after body parsing. The attachment reaches failed once, the client receives an error, and retry can proceed. Not run.
- Medium · A local search fallback is reported as paid AI success12 / 64
12 / 64 Errors & observability · severity 2 × likelihood 3 × blast radius 2
src/hooks/useAISearchWithCredits.ts:30The credit hook calls aiService.searchMemories after deducting credits. That service catches an invocation failure at src/lib/ai.ts:95 and resolves basic text results. The hook therefore shows AI Search successful and retains the debit although AI processing failed.
Fix and verification
High confidence: the client service resolves its local fallback while the caller treats every resolved result as AI success.
Fix: Return a discriminated result for AI versus local fallback. Settle the AI charge only on the paid success path, with durable compensation for failed requests.
Verify: Fail the edge invocation. The UI explicitly labels local search, shows no AI‑success toast, and persisted AI credits are unchanged. Not run.
- Medium · The payment demo does not supply automated regression coverage9 / 64
9 / 64 Tests that matter · severity 1 × likelihood 3 × blast radius 3
The package scripts have build/lint/preview but no test command. The sole tests/razorpay-test.html is an interactive form that invokes functions and displays results; it has no executable assertions for persisted state, failure recovery or repeated delivery. Its existence does not establish payment/auth test coverage.
Fix and verification
High confidence in the checked-in coverage gap; private or external CI suites may exist and were not available.
Fix: Add assertion-based integration tests for two-user access, failed writes, payment retries, concurrent credit changes and migration replay. Keep credentials and live services out of fixtures.
Verify: Run the new suite against disposable staging state; deliberately remove a guard in an authorized test branch and confirm the corresponding regression fails. Not run.
- Medium · Search starts one attachment query per memory8 / 64
8 / 64 Queries & performance · severity 2 × likelihood 4 × blast radius 1
searchMemories uses Promise.all over the full memory array and executes an attachment query for each item before the AI call. Query count and concurrent requests grow linearly with history size. Errors returned as SDK result.error are also not examined in this loop.
Fix and verification
High confidence: one SDK query is created per mapped memory; latency and rate-limit behavior need representative load data.
Fix: Batch attachment retrieval for a bounded page of owned memory IDs, group results locally, and inspect returned errors. Bound concurrency for any remaining fan-out.
Verify: Record database request counts for 1, 10 and 100 memories. Retrieval uses a bounded number of batched requests rather than one per memory. Not run.
- Low · Environment files are not explicitly ignored3 / 64
3 / 64 Secrets & client bundles · severity 1 × likelihood 3 × blast radius 1
The ignore file excludes *.local, build outputs and logs. It does not exclude .env or .env.production. A future local environment file with credentials could be staged accidentally. This finding does not claim a credential was leaked.
Fix and verification
High confidence: the complete ignore file was read; tracked credential exposure and Git history were not inspected.
Fix: Ignore .env and .env.* while allowing a value-free example file. Check tracked filenames separately and rotate only if an authorized credential review confirms exposure.
Verify: Create dummy environment filenames in a temporary checkout; git check-ignore identifies each intended private file while a sanitized example remains trackable. Not run.
Three matches we dropped
src/components/InteractiveGlobe.tsx:25Math.random() sets decorative globe coordinates, not a security identifier; both globe matches were dropped.
supabase/functions/ai-generate-insights/index.ts:6The floating-dependency rule matched a CORS wildcard, not an import or version. All nine such CORS matches were dropped.
supabase/migrations/20250615075552-406bef98-45fc-43b7-a16a-d2a848bc4bd9.sql:24The permissive OTP table policy is explicitly dropped by the later 20250622155025 migration. Reviewing the final migration chain avoids reporting a superseded policy.
Ranks use severity × likelihood × blast radius, each scored from 1–4. The list excludes withheld issues. Provider and gateway settings remain unknown. Every verification step is proposed; none was run against the app.
Download the RecallIQ review · Markdown
