fix: allow RESPONSE_CODE_DETAILS and START_TIME in error page#277
Merged
mattdjenkinson merged 2 commits intoJul 15, 2026
Merged
Conversation
The branded 5xx error page served on the downstream data plane shows a "Status code", "Error details", and "Timestamp" row. Only the first one ever rendered — the other two printed their literal Envoy %OPERATOR% tokens instead of real values. envoyBodyAllowedCommands only permitted %RESPONSE_CODE% through the escaper. Every other %...% token, including %RESPONSE_CODE_DETAILS% and %START_TIME(%Y-%m-%d %H:%M:%S UTC)%, got its percent signs doubled to %%, which Envoy renders back as a literal percent instead of invoking the operator. Add both operators to the allowlist so they resolve like %RESPONSE_CODE% already does.
mattdjenkinson
marked this pull request as ready for review
July 14, 2026 14:32
scotwells
approved these changes
Jul 14, 2026
mattdjenkinson
deleted the
fix/error-page-allowlist-response-details-start-time
branch
July 15, 2026 09:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The branded 5xx error page served on the downstream data plane has three fields: status code, error details, and a timestamp. Only the status code ever rendered. The other two showed up as literal Envoy
%OPERATOR%tokens instead of real values.The escaper that prepares this page for Envoy (
escapeEnvoyFormatLiterals) only allowlists%RESPONSE_CODE%. Every other%...%token, including%RESPONSE_CODE_DETAILS%and%START_TIME(%Y-%m-%d %H:%M:%S UTC)%, gets its percent signs doubled to%%, which Envoy renders back as a literal%instead of invoking the operator. This is deliberate (issue #243: an unescaped literal%in this page's CSS once caused the whole listener xDS update to be rejected), but the allowlist was never extended past the one operator it shipped with.This adds both operators to
envoyBodyAllowedCommandsso they resolve the same way%RESPONSE_CODE%already does.Verified with new cases in
TestEscapeEnvoyFormatLiteralscovering both operators, plus the existingTestEmbeddedDefaultPageIsEnvoySaferegression guard, all passing.