Skip to content

Extension backend refs are dispatched by kind only, so a custom Service kind reaches the core Service resolver #10255

Closed

Description

@zirain

Description:

processDestination (internal/gatewayapi/route.go) skips validateBackendRef for group/kinds registered as extension backend resources (isCustomBackendResource), but then picks the resolver with a switch on the backendRef kind only. A backendRef to an extension resource whose kind collides with a built-in one is therefore handed to the built-in resolver instead of the extension:

  • custom.example.io/Service (an extension CRD named Service in its own group) goes to processServiceDestinationSetting, which looks up a core Service with the same name. If none exists, it dereferences the nil lookup result and route translation panics.

Separately, the extension backend allowlist accepts built-in group/kinds such as multicluster.x-k8s.io/ServiceImport. Built-in backends don't need the extension server, and allowlisting them only disables the usual backendRef validation; a missing ServiceImport then panics the same way in processServiceImportDestinationSetting.

Both cases need control of the EnvoyGateway extension manager configuration; they can't be triggered by route authors or data-plane traffic alone.

Expected:

  • Allowlisted extension group/kinds are always dispatched to the extension, regardless of kind name.
  • EnvoyGateway config validation rejects extension backend resources that are built-in backend kinds (core Service, multicluster.x-k8s.io/ServiceImport, gateway.envoyproxy.io/Backend).
  • A missing Service/ServiceImport in the built-in resolvers is reported as ResolvedRefs=False / BackendNotFound instead of panicking.

Repro steps:

  1. Register an extension backend resource with group custom.example.io, kind Service.
  2. Create an HTTPRoute with a backendRef {group: custom.example.io, kind: Service, name: foo, port: 8080}.
  3. Make sure no core Service foo exists in the route's namespace.

The Gateway API translator panics with a nil pointer dereference in processServiceDestinationSetting.

Environment:

main @ f74a274.

Activity

  1. added
    kind/bug
    area/translator
    on Oct 13, 2026
  2. self-assigned this
    on Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/extensionsarea/translatorkind/bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions