AntFleet

Disagreement · bdb225d0-anthropic-1

Cron route authorization compares Buffers of unequal length via timingSafeEqual without short-circuit safety, but bypasses constant-time when lengths differ

solo Opus
repo e24ef98c·PR #10·reviewed 1 week ago

Opus finding

Cron route authorization compares Buffers of unequal length via timingSafeEqual without short-circuit safety, but bypasses constant-time when lengths differ

lowsecurityhigh
  • apps/web/app/api/cron/sweep/route.ts:30-38
The comment promises constant-time compare to deny a length oracle, but the code itself short-circuits on `a.length !== b.length`. This leaks the expected token length via timing — though only the length, not contents. The mitigation is to compute a fixed-length compare (e.g., pad provided to expected length and always run timingSafeEqual, then check lengths separately). For Vercel cron protected behind edge, the risk is minimal but the comment is misleading.

Recommendation

Either remove the misleading 'length / prefix oracle' claim from the comment, or pad to a fixed buffer (e.g., compare SHA-256 of provided vs expected) so length never short-circuits.

Other reviewer

The other reviewer flagged nothing in this file/line range.

Why this didn't post

This finding didn't meet AntFleet's unanimous agreement threshold. Both frontier models review every PR independently; only findings they both flag with the same severity and category are posted to the PR. This one fell through.

read the methodology →