Skip to content

Add proper file upload validation in document-upload.service with security checks #941

Description

@nanaf6203-bit

Problem

File upload validation may rely on Content-Type header alone without magic byte verification, no virus scanning, and no path traversal prevention.

Expected Outcome

Defense-in-depth upload validation.

Acceptance Criteria

  • MIME type via magic bytes, not just HTTP header
  • Extension whitelist with MIME cross-validation
  • ClamAV integration
  • Path traversal prevention
  • Type-specific size limits

Files Affected

src/documents/document-upload.service.ts, src/properties/property-images.service.ts, src/users/avatar-upload.service.ts

Difficulty

Medium

Estimated Effort

Medium (3-5 days)

Labels

security, file-upload, enhancement

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions