Skip to content
Back to ml-scanner report
ReliabilityMedium

Model Cache Without TTL or Version Key

api/cache.py:45

What's going on

Cached predictions are never invalidated, so stale weights keep serving after a redeploy.

Why it matters

Unaddressed, this degrades the reliability and security of the codebase and accelerates technical debt.

api/cache.py:45

Recommended Fix

Replace the inline query with a parameterized statement and validate the id before it ever reaches the database. A regression test is generated alongside the patch.

Before
1 
After
1 
  1. Uploaddone
  2. Analyzedone
  3. Finddone
  4. Explainactive
  5. Fixupcoming
  6. Testupcoming
  7. Verifyupcoming