Skip to content

Subprocess output pipe doesn't use CurveZMQ #1598

Open

Description

@Darshan808

I noticed this while working on jupyter/jupyter_client#1154.

When a kernel runs with CurveZMQ, all five channels are encrypted. But the pipe that forked child processes use to send output to the parent (IOPubThread._setup_pipe_in in iostream.py) is still a plain TCP socket on 127.0.0.1. The child sends the pipe uuid plus the message in plain text, and the parent forwards it to IOPub after it checks only the uuid.

So on a CURVE kernel:

  • output from forked children isn't encrypted
  • anything that can capture loopback traffic (e.g. a sidecar container in the same pod) can see the uuid

Right now the client's HMAC check still blocks injected messages. But if clients stop checking HMAC on CURVE connections (jupyter/jupyter_client#1154), the uuid becomes the only lock.

Idea for a fix: pass the CURVE keys to IOPubThread, make pipe_in a CURVE server and the child's pipe_out a CURVE client (the same way debug_shell_socket does it), and keep the uuid check.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions