[MEDIUM] Docker SSH force command uses eval for command execution #26

Open
opened 2026-05-05 15:44:48 -05:00 by pjennings · 0 comments
Owner

Labels: area:security, area:containers, priority:medium, type:bug

Description

In modules/profiles/containers/default.nix line 19, the docker SSH validator uses:
eval ""

While the case statement restricts matching to docker/scp/sftp commands, eval could potentially be exploited through command chaining or shell metacharacters.

Impact

Carefully crafted SSH_ORIGINAL_COMMAND could bypass the allowlist through shell injection.

Replace eval with direct execution of matched commands. Whitelist specific command patterns more strictly without shell interpolation.

**Labels:** area:security, area:containers, priority:medium, type:bug ## Description In modules/profiles/containers/default.nix line 19, the docker SSH validator uses: eval "" While the case statement restricts matching to docker/scp/sftp commands, eval could potentially be exploited through command chaining or shell metacharacters. ## Impact Carefully crafted SSH_ORIGINAL_COMMAND could bypass the allowlist through shell injection. ## Recommended Fix Replace eval with direct execution of matched commands. Whitelist specific command patterns more strictly without shell interpolation.
Sign in to join this conversation.
No description provided.