Skip to content

fix: the broker start refuses a credential path with ".." #179

Open

Description

@groupsky

Why

The security review of #178 (nodkey broker check, #173) found that the start of the broker accepts a path such as ${CREDENTIALS_DIRECTORY}/../x. It then reads a file outside the credentials directory of the unit, such as /run/credentials/x. nodkey broker check refuses such a path, so the check and the start do not agree.

The start still checks the file itself (owner, mode, the directories on the way), so this fails closed. But a credential path that leaves the credentials directory is always a mistake.

Done when

  • parsePath (internal/config/config.go) refuses a ${CREDENTIALS_DIRECTORY}/ path whose rest is not local (filepath.IsLocal), with an error that says how to write it. A test.
  • The start, a reload and nodkey broker check give the same error for it. A test.
  • DESIGN.md section 14 says so.

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