Skip to content

Mark ML controller non-dumpable before accepting commands#3081

Draft
edsavage wants to merge 2 commits into
elastic:mainfrom
edsavage:security/controller-non-dumpable
Draft

Mark ML controller non-dumpable before accepting commands#3081
edsavage wants to merge 2 commits into
elastic:mainfrom
edsavage:security/controller-non-dumpable

Conversation

@edsavage

Copy link
Copy Markdown
Contributor

Summary

Follow-up to elastic/security#12621 (HackerOne): the ML controller shared UID 1000 with the JVM / pytorch_inference and remained dumpable, so a compromised peer could write /proc/<controller-pid>/mem, overwrite access@GOT, and turn access(path, X_OK) into dlopen(path, RTLD_LAZY) (X_OK == RTLD_LAZY == 1) when handling a spawn command — loading attacker code under the controller’s laxer RuntimeDefault-only seccomp.

Fix

After logging is reconfigured and before opening command/output pipes (i.e. before accepting commands):

  1. prctl(PR_SET_DUMPABLE, 0)
  2. Confirm with prctl(PR_GET_DUMPABLE) == 0
  3. Fail closed (LOG_FATAL + EXIT_FAILURE) if either step fails

No-op on non-Linux platforms (/proc/<pid>/mem same-UID writes are the Linux concern).

Test plan

  • Linux CI: controller still starts and processes commands normally.
  • On Linux: after start, /proc/<controller-pid>/status shows Dumpable: 0 (or equivalent).
  • Confirm fail-closed path if PR_SET_DUMPABLE cannot be applied (manual / mocked).

Related: #3078 (__setstate__ pre-load), #3080 (seccomp arch/ABI check).

Made with Cursor

Same-UID peers in the shared ES/ml-cpp pod could write /proc/<controller-pid>/mem
and overwrite access@GOT so a spawn's access(path, X_OK) became
dlopen(path, RTLD_LAZY) (elastic/security#12621). Call prctl(PR_SET_DUMPABLE, 0)
after logging is up and before opening command pipes; verify with
PR_GET_DUMPABLE and fail closed if the boundary cannot be established.

No-op on non-Linux platforms where /proc/<pid>/mem is not the concern.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants