cilium / cilium/proxy

LocalReplyConfig Body Rewrite Generates Null Bytes in Cilium Envoy

Open
#1,735 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
190
Forks
99
Avg merge
1d 5h
Merged PRs (30d)
30

Description

When using Cilium Envoy's LocalReplyConfig for response body rewriting, configuring body with inline_string content results in the response body containing null bytes (0x00) equal in length to the specified string, rather than the expected text content.

Cilium Version:1.18.6
Kubernetes Version: 1.29.9

local_reply_config:
  mappers:
  - filter:
      status_code_filter:
        comparison:
          op: EQ
          value:
            default_value: 404
    body_format_override:
      text_format: "Custom 404: %REQ(:path)% not found"
  body_format:
    text_format: "Default error: %RESPONSE_CODE%"

Expected Behavior
When the configured status code (e.g., 404) is triggered, the response body should contain the configured custom text message.

Actual Behavior
The response body contains null bytes (0x00) equal in length to the configured string. For example:

Configured string: "Custom 404: /api not found" (24 characters)

Actual response: 24 null bytes

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the LocalReplyConfig response-body rewrite with the supplied Cilium and Kubernetes versions, using the shown mappers and inline text configuration. Trace how the configured body text is converted before Envoy sends the response. Done means a triggered 404 returns the configured text, including the path, rather than same-length null bytes.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.