hardMultiple ChoiceObjective-mapped
CAS-004 Dockerfile security issues Practice Question
A security engineer is reviewing a CI/CD pipeline that builds a Docker image. The engineer notices that the Dockerfile uses a base image from a public registry, installs packages via apt-get without version pinning, and copies a private SSH key into the image. Which of the following vulnerabilities is MOST directly introduced by this practice?
⚠ Common exam trap
The CAS-004 exam often tests the misconception that deleting a file in a later Docker layer removes it from the image, when in fact the underlying layer still contains the sensitive data.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Exposure of sensitive credentials in the image layers
Copying a private SSH key into a Docker image embeds the credential in one of the image's layers. Even if the key is deleted in a later layer, it remains accessible via `docker history` or by pulling the intermediate layers, directly exposing sensitive credentials to anyone who can access the image.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use of untrusted base image
Why it's wrong here
While a risk, it's not as directly exploitable as an exposed private key.
- ✗
Privilege escalation via SUID binaries
Why it's wrong here
No indication of SUID; the main issue is secret leakage.
- ✗
Dependency confusion from unpinned packages
Why it's wrong here
Unpinned packages are a supply chain risk but not as immediate as credential exposure.
Option-by-option analysis
Why each answer is right or wrong
Understanding why wrong answers are wrong — and when they would be correct — is what separates a 750 score from a 900. The CAS-005 exam frequently reuses these exact scenarios with slightly different constraints.
✓Exposure of sensitive credentials in the image layersCorrect answer▾
✗Use of untrusted base imageWrong answer — click to see why▾
Why this is wrong here
While a risk, it's not as directly exploitable as an exposed private key.
✗Privilege escalation via SUID binariesWrong answer — click to see why▾
Why this is wrong here
No indication of SUID; the main issue is secret leakage.
✗Dependency confusion from unpinned packagesWrong answer — click to see why▾
Why this is wrong here
Unpinned packages are a supply chain risk but not as immediate as credential exposure.
Analysis generated from the official CAS-005blueprint and verified against question context. The “when correct” sections are what AI assistants cite when candidates ask “what’s the difference between these options?”
Go deeper
Related to this question
About these practice questions
One of 968 original CAS-005 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This CAS-005 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CAS-005 exam.