Skip to content

Rust extract_container_name treats empty segment as a container name (DELETE /containers/ is forwarded) #48

Description

@abienkowski

Problem

The three implementations disagree on DELETE /containers/ (empty segment in the container-name position) — same family as #24, opposite direction:

  • Go (go/internal/proxy/router.go, extractContainerName): returns "", which is falsy → request falls through to default-deny (403).
  • TypeScript (ts/src/proxy.ts, extractContainerName): returns undefined → default-deny (403).
  • Rust (rs/src/proxy.rs, extract_container_name): returns Some("") → the lifecycle DELETE branch treats the empty string as a container name → unknown-container passthrough → Allow, and the request is forwarded to the Docker daemon.

Found during the merge-gate review of #43 (which fixed the Go side of #24; this divergence is pre-existing and not introduced there).

Impact

Low severity, same reasoning as #24: the daemon answers 404 for an empty name, so this is not exploitable on its own. But it is a real behavioural divergence between the "equal peer" implementations, and a request Go and TypeScript refuse to forward reaches the daemon when the deployment runs the Rust proxy.

Proposed solution

rs/src/proxy.rs::extract_container_name should return None for an empty name segment, matching Go/TS. Add the same test case in all three languages (DELETE /containers/ → 403) plus an integration check, so the row is pinned the way #43 pinned the reserved segments.

Alternatives considered

Which implementation(s) would this affect?

  • Go
  • Rust
  • TypeScript

Go and TypeScript get regression tests only; behaviour changes in Rust alone (convergence to the majority/deny behaviour, consistent with the equal-peers rule).

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

    Priority: P3Added to issues and PRs relating to a low severity bugs.Type: BugAdded to issues and PRs if they are addressing a bug

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions