fix(#329): Harden BudgetService against security review findings
- Fix CRITICAL: Unbounded memory growth via daily record purging - Fix CRITICAL: Negative/NaN/Infinity token bypass via input clamping - Fix HIGH: TOCTOU race via atomic trySpawnAgent() method - Fix HIGH: Phantom agent leak via Set<string> ID tracking (not counter) - Fix HIGH: isAgentOverBudget now scoped to today only - Fix HIGH: Config validation clamps invalid values to safe defaults - Fix MEDIUM: Wire BudgetModule into AppModule - Fix MEDIUM: Sanitize agentId in log output to prevent log injection - Fix MEDIUM: Use Date objects for timezone-safe comparisons - Fix MEDIUM: Reject empty agentId/taskId in recordUsage - Add tests for negative tokens, NaN, Infinity, empty IDs, config edge cases Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import { BullModule } from "@nestjs/bullmq";
|
||||
import { HealthModule } from "./api/health/health.module";
|
||||
import { AgentsModule } from "./api/agents/agents.module";
|
||||
import { CoordinatorModule } from "./coordinator/coordinator.module";
|
||||
import { BudgetModule } from "./budget/budget.module";
|
||||
import { orchestratorConfig } from "./config/orchestrator.config";
|
||||
|
||||
@Module({
|
||||
@@ -21,6 +22,7 @@ import { orchestratorConfig } from "./config/orchestrator.config";
|
||||
HealthModule,
|
||||
AgentsModule,
|
||||
CoordinatorModule,
|
||||
BudgetModule,
|
||||
],
|
||||
})
|
||||
export class AppModule {}
|
||||
|
||||
Reference in New Issue
Block a user