Skip to interview prep
Apexed

57. A file has an allowed extension and a matching browser-supplied content type. What validation remains?

EasyApplication & data security

Technical
Show model answer

Both fields are supplied or influenced by the uploader and can misdescribe the content. Apply a narrow permitted-format policy and inspect the file through appropriate maintained parsing or content-validation controls.

Also bound size and processing cost, generate safe storage names and control download behavior. Quarantine rejected or unverified files according to policy; a successful upload does not establish that the content is safe to parse or publish.

What interviewers listen for

  • Do not trust uploader metadata alone
  • Validate supported content and limits
  • Control storage and delivery
A file has an allowed extension and a matching browser-supplied content type. What validation remains — Cybersecurity interview question — Apexed