Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST
Cloud & DevOps
Kubernetes & Docker

Our 1.2GB Node Image Shipped a Shell, npm, and a CVE We Never Scanned For

Learn to rebuild container images as multi-stage, distroless, least-privilege artifacts that pass audit and still deploy in seconds.

MCB Editorial
MCB Editorial
Tech Buzz Daily Desk · 10 min read ·
New story
Our 1.2GB Node Image Shipped a Shell, npm, and a CVE We Never Scanned For
Narrated by Study Buddy Narration
Voiceover Engine • Interactive Audio Sync
0:0010:00

Learning Objectives & Key Takeaways

0 / 4 Completed
🚀 Architecture Ready
100%
What you will learn
  1. Multi-stage builds separate compilers and package managers from the artifact that actually ships to production.
  2. Distroless or scratch final stages remove shells and package managers, shrinking attack surface, not just image size.
  3. COPY --from=<stage> only transfers what you explicitly name, so runtime dependencies must be copied deliberately.
  4. Kubernetes securityContext settings like readOnlyRootFilesystem and dropped capabilities complete what the image alone cannot enforce.
  5. A smaller image is not an unscanned image; Docker Scout and CI-based validation remain mandatory.

The Pager Went Off Because of a Shell Nobody Used

Our security team ran a routine scan against the production image for our internal billing API and flagged forty-one CVEs, several rated critical, all living inside a shell and a package manager that no running process ever touched.

The image was built with a single FROM node:18 statement, copied the entire repository including devDependencies, test fixtures, and a stray .env.example file, and weighed in at 1.2 gigabytes.

In the rest of this story
  1. Why Multi-Stage Builds Exist
  2. Rebuilding the Billing API the Right Way
  3. When Scratch Beats Even Distroless
  4. The Image Is Only Half the Job
  5. Scanning and Signing Are Not Optional Extras
2 code examples · 10 min read in full
Member-only story

Checking your membership…

Members read every Tech Buzz story in full, with code examples, audio and the discussion, plus every course, quiz and interview set in the Learning Dashboard.

0
MCB Editorial
Written By

MCB Editorial

Tech Buzz Daily Desk. Contributing deep-dive engineering architectures, cloud paradigms, and system design insights to Master Class Buddy.