@@ -13,6 +13,7 @@ An autonomous, production-grade audit and remediation cycle was executed on the
All findings across authentication security, layered architecture boundaries, race conditions, N+1 queries, IDOR/ownership authorization, pagination bounds, zero-hardcode compliance, and response envelopes were triaged, verified against active code, repaired, and validated through the automated test suite.
| **BUG-18** | 🟢 P3 | App | Morgan logger hardcoded to `"dev"` in production | CONFIRMED | **FIXED (Environment-aware)** |
---
## Fixed Issues Detail
### [BUG-01] Auth: Reset Token Leakage Across Service Boundary
-**Severity**: 🔴 P0
-**Module**: `auth`
-**Root Cause**: `AuthService.forgotPassword()` returned `{ success: true, resetToken, userId }` so that the controller could invoke `MailService`. This exposed sensitive reset tokens across architectural boundaries and to potential loggers/interceptors.
...
...
@@ -63,6 +65,7 @@ All findings across authentication security, layered architecture boundaries, ra
---
### [BUG-02] Architecture: Direct `@prisma/client` Import Isolation
-**Severity**: 🔴 P0
-**Module**: `cross-cutting`
-**Root Cause**: Non-repository modules (`crawl-pages`, `webhooks`, `exports`, `users`, `change-detection`, `api-keys`) were importing enums and types directly from `@prisma/client`, violating `AGENTS.md` Rule 1.
...
...
@@ -105,6 +108,7 @@ All findings across authentication security, layered architecture boundaries, ra
-**Root Cause**: `crawlScheduleQuerySchema` parsed string values without `.max(100)` or integer validation, creating DoS and NaN risks. In addition, `createCrawlScheduleSchema` mutated data within `superRefine`.
...
...
@@ -118,6 +122,7 @@ All findings across authentication security, layered architecture boundaries, ra
-**Root Cause**: Non-atomic read-then-write check allowed race conditions where a worker could overwrite a `CANCELED` job back to `RUNNING` or `COMPLETED`.
...
...
@@ -130,6 +135,7 @@ All findings across authentication security, layered architecture boundaries, ra
---
### [BUG-06] Worker: Redundant Status Transition Cleanup
-**Severity**: 🟠 P1
-**Module**: `worker`
-**Root Cause**: `processCrawlJob` called `updateStatus(RUNNING)` twice (before and after pre-crawl URL validation), overwriting `startedAt`.
...
...
@@ -141,6 +147,7 @@ All findings across authentication security, layered architecture boundaries, ra
-**Root Cause**: `getAssets` performed manual parsing without Zod and response metadata omitted `total` and `totalPages`. `getLogs` returned `{ pagination }` instead of `{ meta }`.
...
...
@@ -184,6 +193,7 @@ All findings across authentication security, layered architecture boundaries, ra