Copy With More Than Two Arguments Not Ending With Slash
- Query id: 6db6e0c2-32a3-4a2e-93b5-72c35f4119db
- Query name: Copy With More Than Two Arguments Not Ending With Slash
- Platform: Dockerfile
- Severity: Low
- Category: Build Process
- CWE: 628
- Risk score: 1.9
- URL: Github
Description¶
When a COPY command has more than two arguments, the last one should end with a slash
Documentation
Code samples¶
Code samples with security vulnerabilities¶
Positive test num. 2 - dockerfile file
ARG ANY_IMAGE
FROM ${ANY_IMAGE}
COPY readme.md *.xml* .\Config\example\
Positive test num. 3 - dockerfile file
# escape=\
ARG ANY_IMAGE
FROM ${ANY_IMAGE}
COPY readme.md *.xml* .\Config\example\
Code samples without security vulnerabilities¶
Negative test num. 3 - dockerfile file
# escape=`
ARG ANY_IMAGE
FROM ${ANY_IMAGE}
COPY readme.md *.xml* .\Config\example\