Securing file uploads in a CMS
CVs, artwork and documents are the most commonly exploited part of any content-managed site. A practical checklist.
Applicant CVs are personally identifiable information and often the weakest link in a recruitment workflow. Treat them as private data, not uploads.
The checklist
- Validate MIME type and extension server-side, never trust the client
- Randomise filenames; never derive paths from user input
- Store on a private disk with no public URL
- Serve downloads through an authorising controller, and log every access
- Set size limits and rate-limit the endpoint
Also sanitise rich text on write and again on render. HTMLPurifier with an allowlist is unglamorous and effective.
Related articles
The case against a microservices-first architecture
For most teams under fifty engineers, a well-structured monolith ships faster and costs less. Here is where we draw the line.
Read articleLegacy modernisation without a big-bang rewrite
Strangler-fig patterns let you replace a legacy system incrementally, with value delivered every few weeks.
Read articleWhat we look for when hiring engineers
Not leetcode. We care about how you reason about trade-offs, communicate uncertainty and handle being wrong.
Read article