Skip to content

Enforce the BuildKit frontend policy for explicit build arguments #544

Done

Description

@samuelmbabhazi

Related: #215. Audited main: deff5f611308aa538cd3981c3e66ca8dd22cced7; PR #541: 8c6a3873f5b5a9c5c995e24529a8a7eba1061ae6.

Problem and conditions

A repository configuration can supply build.args.BUILDKIT_SYNTAX. The API and agent accept this as an ordinary build argument, but BuildKit interprets it as a frontend selector. In the Nixpacks path, explicit arguments bypass the function that deliberately removes BUILDKIT_* names to prevent changing the Dockerfile frontend.

The actor must be able to change the Git configuration that Shipkeep accepts and have a build deployed. This is not an unauthenticated API issue. Main already accepts the argument for Dockerfile builds; PR #541 makes the Nixpacks path reachable through normal Git application deployments. These are one frontend-policy issue, not two independent vulnerabilities.

Evidence

A pure local test passed through the real applicationConfig → plan → agentAction implementations and confirmed propagation with BuildType.NIXPACKS. It used an inert .invalid marker and fake credentials. The relevant API and agent files remain identical at PR #541 head 23dbfe5ef49b209e0bef36fbe8ad1a3e487c3fe7, rechecked before publication.

Impact and limits

The supplied argument can select a frontend outside the intended Nixpacks-generated build path. That crosses the boundary between application build parameters and the component interpreting the build and its session inputs. The current SPEC does not explicitly reserve these names globally; a Dockerfile frontend directive may be intentional functionality, so its policy must be decided explicitly.

No external frontend, secret-access payload, or exfiltration was executed. This evidence establishes acceptance and a reachable selector, not credential theft or a container escape.

Proposed correction and acceptance

Apply one reserved-argument policy to explicit and generated arguments, with agent-side enforcement and an API validation error. Define separately whether user-selected Dockerfile frontends are permitted; if permitted, document and constrain their session capabilities rather than treating them as trusted.

  • Explicit arguments cannot restore a name removed by the Nixpacks filter.
  • Tests cover reserved arguments through configuration, planning and agent validation, plus ordinary arguments.
  • Tests and documentation specify the policy for both BUILDKIT_SYNTAX and Dockerfile frontend directives.
  • The fix does not depend on hiding a secret identifier from an otherwise untrusted frontend.

Publication check (2026-11-27): main advanced to 817f6ac3b00fdb0e81331e519abc5668a1560aee through #539. The affected production paths cited above are unchanged; the source links retain the audited revision.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority:P2securitytrack:agenttrack:control-plane

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions