Skip to content

fix(#59): harden ext.* surface, gate chmod, log volume substitution, consolidate parse - #72

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/59-harden-ext
Jul 17, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/59-harden-ext

Conversation

@scttfrdmn

Copy link
Copy Markdown
Collaborator

Closes the remaining 2026-06 audit items for nf-spawn (#59). The rest were already fixed; these are the 4 that were still open (submit() async is separately tracked by #70).

Security

  • Validate constrained ext.* directives before launch (M). ext.instanceType/region/az/ttl/ami fail fast on malformed values via a new validateExtDirectives. ext.setup/command/packages/container/runOptions are intentionally not validated — arbitrary strings that run as root by design (same trust model as ext.args/script on any Nextflow executor); documented in-code as a root-RCE surface rather than given false-security sanitization.
  • chmod 0777 gated behind the container branch (L). Bare-OS tasks run as the dir owner and no longer get a world-writable work dir; the relaxation stays only for non-root container images.

Correctness

  • ext.volumes zero-copy symlink substitution is now logged (M). The match is by basename, so a coincidental collision would symlink an unrelated input onto the reference volume and skip its copy — each substitution is now announced to stderr so a wrong match is diagnosable instead of silently serving wrong data.

Health

  • ext.volumes parsed once into a typed VolumeSpec list that the three views (attach-volume args, docker -v, mount paths) derive from — replacing three divergent traversals.

Tests

New: validateExtDirectives (well-formed / empty / 8 malformed cases), container-gated chmod, substitution logging. Full Spock suite green (JDK 17).

Closes #59.

…consolidate parse

Closes the remaining 2026-06 audit items for nf-spawn:

- SECURITY (M): validate the constrained ext.* directives (instanceType/region/
  az/ttl/ami) before launch via validateExtDirectives — fail fast on malformed
  values. ext.setup/command/packages/container/runOptions are intentionally NOT
  validated (arbitrary root-run input by design, same trust as ext.args/script);
  documented in-code as a root-RCE surface.
- SECURITY (L): chmod 0777 on the work dir is now gated behind the container
  branch — bare-OS tasks (run as the dir owner) no longer get a world-writable
  work dir.
- CORRECTNESS (M): the ext.volumes basename-match zero-copy symlink now logs each
  substitution to stderr, so a coincidental basename collision (wrong DB served)
  is diagnosable instead of silent.
- HEALTH (L): ext.volumes is parsed once into a typed VolumeSpec list that all
  three views derive from, replacing three divergent traversals.

New tests: validateExtDirectives (well-formed/empty/8 malformed cases),
container-gated chmod, and substitution logging. Full Spock suite green.

submit() synchronous-launch (L corr) is out of scope — tracked by #70.

Closes #59.
@scttfrdmn
scttfrdmn merged commit 0e660a4 into main Jul 17, 2026
4 checks passed
@scttfrdmn
scttfrdmn deleted the fix/59-harden-ext branch July 17, 2026 23:26
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.

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

1 participant