As asked
Your product is adding a feature where users can upload arbitrary files to share with other users. Threat model it.
Sample answer outline
Use STRIDE or a similar framework. Spoofing: who can upload, is auth required, is the user-id on the upload trusted. Tampering: file type lying about MIME (sniff the content, do not trust the header), filename traversal, content-disposition tricks. Repudiation: audit log of uploads. Information disclosure: are files private by default, signed URLs with expiry. Denial of service: max file size, rate limits, virus scanning. Elevation of privilege: stored XSS via uploaded HTML, malware delivery, hosting attacker-controlled JS. Concrete mitigations: serve user content from a separate origin, force download for unknown types, scan async, signed URLs.
Expect these follow-ups
- How do you serve user-uploaded images without enabling stored XSS?
- What is your virus scanning policy and what do you do on a positive hit?
- How would you handle the same feature for a regulated industry (healthcare, finance)?