Skip to content

[audit] Medium/Low findings tracker (2026-06 suite audit) #59

Closed

Description

@scttfrdmn

Consolidated Medium/Low for nf-spawn. High: #58.

  • [M sec] User-controlled ext.setup/packages/container/runOptions/instanceType spliced into root user-data + docker argv unvalidated. → document ext.setup as root RCE; allowlist instanceType, bound ttl, validate region/ami; build docker argv as a list.
  • [M sec] Staging temp file with full task script never deleted (info disclosure + /tmp accumulation). → delete in finally / deleteOnExit().
  • [M corr] set -uo pipefail (no -e); output up-sync + .exitcode upload unguarded → silent partial success. → guard syncs; on output-sync failure write non-zero .exitcode or skip upload.
  • [M health] CI never runs the Spock suite (only guard on generated-shell correctness). → add ./gradlew test to ci.yml, gate release.
  • [M corr] ext.volumes basename matching can mis-symlink an unrelated input to a reference-DB mount. → tighten match (explicit mapping/dir-style); log every symlink substitution.
  • [L sec] Work dir chmod 0777 unconditionally, even bare-OS tasks. → gate behind container branch; prefer chown to container UID/GID or --user.
  • [L corr] submit() launches synchronously (blocks executor thread); redundant putAll(getenv()). → waitFor() timeout; drop redundant putAll.
  • [L ergo] No validation for unset/non-S3 workDir; task hangs in RUNNING. → validate workDirStr starts with s3:// in submit(), throw AbortOperationException.
  • [L health] ext.volumes parsed three times with divergent error handling. → parse once into typed List, derive args/mounts.

Activity

  1. added
    bug
    on Jun 15, 2026
  2. added a commit that references this issue on Jun 21, 2026
  3. scttfrdmn commented on Jun 21, 2026

    @scttfrdmn
    CollaboratorAuthor

    Addressed in 6dd00ab (CI will validate — no local JDK here, so the now-enabled Spock suite is the gate):

    • ✅ [M sec] Staging temp file (full task script) now deleted after launch (try/finally + deleteOnExit backstop).
    • ✅ [M corr] Unguarded output sync → silent partial success: .exitcode is now written after the output up-sync, and a sync failure flips a success code to non-zero so Nextflow sees a task failure rather than a success with missing outputs.
    • ✅ [M health] CI now runs ./gradlew test (was assemble-only).
    • ✅ [L ergo] Fail fast on unset/non-s3:// workDir instead of hanging the task in RUNNING.
    • ✅ [L corr] Dropped redundant putAll(System.getenv()).

    Deferred (leaving open):

    • [M sec] User-controlled ext.setup/packages/container/runOptions/instanceType spliced into root user-data + docker argv. Needs a design call: document ext.setup as root-RCE-by-design vs. allowlist instanceType / bound ttl / validate region+ami / build docker argv as a list. (killTask synchronous-submit blocking is also still here.)
    • [M corr] ext.volumes basename matching can mis-symlink an unrelated input to a reference-DB mount — needs tighter (explicit/dir-style) matching + logging each substitution.
    • [L sec] Work dir chmod 0777 unconditional even for bare-OS tasks → gate behind the container branch.
    • [L health] ext.volumes parsed three times — parse once into a typed list.
  4. scttfrdmn commented on Jul 16, 2026

    @scttfrdmn
    CollaboratorAuthor

    Re-verification against current code (~v0.8.0) — 2026-07-16

    4 fixed, 1 partial, 4 still open. All refs in src/main/groovy/io/nextflow/spawn/SpawnTaskHandler.groovy unless noted.

    • [M sec] Untrusted ext. → root user-data + docker argv* — ❌ STILL-OPEN. ext.setup spliced verbatim into root user-data with no validation/doc-warning (buildSetupScript:635-639); instanceType not allowlisted (:41), ttl unbounded (:44), region/ami unvalidated (:42,:46); docker argv still built as a string (buildRunLine:912-914). (ext.packages IS shell-quoted, :629.)
    • [M sec] Staging temp file never deleted — ✅ FIXED. createTempFile + deleteOnExit (:143-144) + Files.deleteIfExists in finally (:164-166).
    • [M corr] set -uo pipefail, unguarded up-sync — ✅ FIXED. Output-sync failure forces TASK_RC=75 (:714-718); input staging guarded (:829). Silent-partial-success closed.
    • [M health] CI never runs Spock suite — ✅ FIXED. ci.yml:44-45 runs ./gradlew test (cites [audit] Medium/Low findings tracker (2026-06 suite audit) #59).
    • [M corr] ext.volumes basename mis-symlink — ❌ STILL-OPEN. Still basename-only match (buildInputStaging:750-772); Forward ext.fsx (and ext.efs) to spawn launch for shared reference filesystems #67 reused the same map for shared-FS, widening the collision surface. No disambiguation.
    • [L sec] Work dir chmod 0777 unconditional — ❌ STILL-OPEN. buildStagingScript emits chmod 0777 with no container guard (:673); bare-OS tasks get world-writable work dir.
    • [L corr] submit() synchronous + redundant getenv — ⚠️ PARTIAL. Redundant putAll(getenv) removed (:156-157); synchronous pb.start/waitFor still blocks the dispatch thread (:161-163) — consistent with open High fan-out is dispatch-bound: serial per-task launch caps concurrency (~60 at N=108) — bulk/pooled dispatch via cohort #70.
    • [L ergo] No validation for non-S3 workDir — ✅ FIXED. submit() throws AbortOperationException if workDir not s3:// (:87-91).
    • [L health] ext.volumes parsed 3× divergently — ❌ STILL-OPEN. parseVolumeSpecs (:482) throws, volumeBindMounts (:517)/volumeMountPaths (:546) silently continue — invoked separately at :58/:111/:138. No typed List.

    Remaining: ext.* RCE-surface hardening (M sec), volumes basename mis-symlink (M corr), chmod-0777 guard (L sec), consolidate volume parsing (L health). submit() async → tracked by #70.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions