Summary
Vehicle uploads trust the caller-provided Content-Type and do not run the KYC file signature checks. A file labeled as an image can contain another format or pathological dimensions.
Repository evidence
app/api/upload/route.ts:71-85 checks the MIME header and byte length for both scopes.
- Only the KYC branch calls
validateKycFile at app/api/upload/route.ts:89-105; the vehicle branch writes bytes directly at :180-185.
Scope
- Decode and validate approved image formats by magic bytes and bounded dimensions/pixels.
- Normalize images or reject malformed, polyglot, truncated, and decompression-bomb inputs.
Acceptance criteria
Tests
Non-goals
- Adding new accepted image formats.
Summary
Vehicle uploads trust the caller-provided Content-Type and do not run the KYC file signature checks. A file labeled as an image can contain another format or pathological dimensions.
Repository evidence
app/api/upload/route.ts:71-85checks the MIME header and byte length for both scopes.validateKycFileatapp/api/upload/route.ts:89-105; the vehicle branch writes bytes directly at:180-185.Scope
Acceptance criteria
Tests
Non-goals