LocalReplyConfig Body Rewrite Generates Null Bytes in Cilium Envoy
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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