dstack icon indicating copy to clipboard operation
dstack copied to clipboard

3 critical Go CVEs in runner/go.mod (SSH PublicKeyCallback auth bypass, Moby, go-git) + 21 workflow inputs interpolation

Open elfrost opened this issue 6 months ago • 2 comments

Hi dstack team,

While testing AI PatchLab (an open-source local-first SAST/SCA scanner) on a range of AI/agent projects, I scanned dstack at `39d34533748d`. Three published-CVE bumps + one mechanical CI cleanup pass are worth flagging together.

Full curated write-up (incl. the false positives — `logger-credential-leak` continues to over-fire across the series, test-fixture "secrets", etc.): https://elfrost.github.io/ai-patchlab/scans/dstackai-dstack.html

1. Three critical Go dependency CVEs in `runner/go.mod`

All three have public fix versions and are single-line bumps. Ordered by relevance to dstack's architecture:

CVE-2024-45337 — `golang.org/x/crypto` SSH `PublicKeyCallback` auth bypass

Applications and libraries which misuse `connection.serverAuthenticate` (via callback field `ServerConfig.PublicKeyCallback`) may be susceptible to an authorization bypass.

This one is directly relevant — dstack's runner SSH's into remote VMs to manage workloads. The advisory's misuse pattern (treating "callback returned `nil` error once" as authorization) is exactly the trap the SSH library docs warn about. Fix: `golang.org/x/crypto >= 0.31.0`.

CVE-2024-41110 — Moby (Docker) authorization plugin bypass

A security vulnerability has been detected in certain versions of Docker Engine, which could allow an attacker to bypass authorization plugins (AuthZ) under specific circumstances.

Applies when the runner is deployed in environments using Docker's authorization-plugin layer. Fix: `github.com/docker/docker` to one of the patched branches (23.0.15 / 26.1.5 / 27.1.1 / 25.0.6).

CVE-2025-21613 — go-git argument injection

An argument injection vulnerability was discovered in go-git versions prior to v5.13. Successful exploitation could allow an attacker to set arbitrary command-line arguments.

Used by the runner to fetch repositories for workloads. If a user-controlled remote URL ever reaches the affected APIs, this is an argument-injection vector. Fix: `github.com/go-git/go-git/v5 >= 5.13.0`.

2. 21× workflow `${{ ... }}` shell interpolation across 8 yml files

`.github/workflows/{build-artifacts,docker-amd-smi,...}.yml` interpolate `${{ ... }}` values into `run:` shell blocks at workflow-parse time, before shell quoting applies.

Same class resolved upstream in gptme PR #2399 and PraisonAI PR #1677. The fix is mechanical:

```yaml

  • name: Step env: SOMETHING: ${{ inputs.something }} run: | cmd --arg "$SOMETHING" ```

21 occurrences across 8 files — worth one dedicated cleanup pass rather than per-file fixes.

3. ~9 Dockerfiles run as root

`docker/{amd-smi,base/Dockerfile.common,dind,server/Dockerfile.nebius,server/release,...}/Dockerfile` all end without a `USER` directive. Four of these also omit `--no-install-recommends` on `apt-get install`. A shared base image with a `USER` directive baked in fixes the class at once.

4. `exec.Command` in the runner — just a comment

`runner/internal/runner/executor/executor.go:512`, `runner/internal/runner/ssh/sshd.go:126`, `runner/internal/shim/components/utils.go:101`, `runner/internal/shim/dcgm/exporter.go:126` all use `exec.Command` to launch processes. This is by design — the runner is a job-execution agent. No change needed; a one-line code comment documenting the trust boundary (user authors workload spec, user runs the runner under their own identity) just stops scanners from re-flagging.


Happy to open PRs for any of these. Thanks for dstack — the scan also turned up plenty of false positives that are worth understanding: four `logger-credential-leak` findings in `src/dstack/_internal/core/services/...` are the same rule class that has now produced 6/6 false positives across this series (it fires on proximity to variable names like `token` / `secret` rather than data-flow). The 11 `secret detected` findings remaining post-ignore-file are all in tests (`src/tests/_internal/server/services/encryption/test_encryption.py` etc.) and frontend form-label constants.

elfrost avatar May 26 '26 13:05 elfrost

Dear @elfrost, we're deleting this issue since its description contains direct advertising of another repo and is considered spam. If you care to submit security reports to dstack repo, do not include any third-party repo links, plus do submit security issues separately (one vulnerability per issue) and ensure to describe how the vulnerability can be exploited by dstack users. Shallow runs of security tools on a repo are not accepted. Really appreciate your good will to improve security of other repos though!

peterschmidt85 avatar May 27 '26 07:05 peterschmidt85

Ok your choice but im not making any money. Its a real secutity scan No one else closed it by saying im advertising. Have a very good day and sorry for this issue

elfrost avatar May 27 '26 11:05 elfrost