Skip to content

Fix possible by not specifying a USER, a program in the container may run as 'root' in Dockerfile - #8

Open
begininvoke wants to merge 1 commit into
fabraix:masterfrom
begininvoke:redgem/security-fix-7f0d5325
Open

Fix possible by not specifying a USER, a program in the container may run as 'root' in Dockerfile#8
begininvoke wants to merge 1 commit into
fabraix:masterfrom
begininvoke:redgem/security-fix-7f0d5325

Conversation

@begininvoke

Copy link
Copy Markdown

Small change to Dockerfile — a scan flagged the code below and it looked genuine. It is around line 46.

The Dockerfile lacks a USER directive, causing the container to run processes as the root user. This unnecessary privilege means any compromised process can gain full control of the container, greatly expanding the impact of an intrusion. The issue follows CWE‑250 (Execution with Unnecessary Privileges) and poses a high security risk.

Adds a non-root USER node to prevent running the serve process as root, addressing the missing USER security issue.

For reference: rule dockerfile.security.missing-user.missing-user, CWE-250 (Execution with Unnecessary Privileges). Rated high.

Take or leave whichever parts are useful. If this is not the right approach, closing is fine.


Found with automated scanning (RedGem) and reviewed before opening. If it is not useful, closing it is completely fine.

…ay run as 'root'. This is a security hazard. If an
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant