I Wrapped ClamAV for Node.js So You Don't Have To
File upload endpoints are a standard attack surface. The fix — scanning uploads before accepting them — is well understood in theory and largely ignored in practice.
The reason is friction. ClamAV, the de facto open-source antivirus engine, does not have a clean Node.js interface. If you want to scan a file against it, you write infrastructure code: manage a daemon, open a TCP socket, speak the INSTREAM protocol, parse the response, handle reconnection, wrap all of it in error handling. It works, but it's the kind of boilerplate that either never gets written or gets copy-pasted across projects without being maintained.
I built pompelmi to eliminate that overhead.
What the Raw Problem Looks Like
ClamAV runs in two modes. The first is clamscan, a CLI tool that scans a file and exits with code 0 (clean), 1 (infected), or 2 (error). Simple, but a new process for every scan.
...
Copyright of this story solely belongs to hackernoon.com. To see the full text click HERE