Skip to main content

Impact & Risk Analysis

  • Severity: Medium
  • CIS Benchmark: CIS 4.9
  • Impact: Malicious File Download & Zip Bombs. The ADD instruction can retrieve files from remote URLs and automatically unpack them. This introduces security risks where malicious files might be downloaded without scanning, or vulnerabilities associated with decompression (like Zip Bombs) could be exploited.

Common Misconfiguration

Using the ADD instruction to copy files into the image. While ADD allows for remote file retrieval and auto-extraction, these features make the build process unpredictable and potentially insecure compared to the COPY instruction.

Vulnerable Example

Secure Example

Audit Procedure

Run the command below to get the list of images:
Run the command below against each image in the list above and look for any ADD instructions:
Alternatively, if you have access to the Dockerfile for the image, verify that there are no ADD instructions present.

Remediation

You should use COPY rather than ADD instructions in Dockerfiles. The COPY instruction simply copies files from the local host machine to the container file system without the risks associated with remote URL retrieval or automatic decompression.