Description
The outgoing HttpClient latency enricher (AddHttpClientLatencyTelemetry)
serializes the LatencyInfo tag value as a positional string but escapes nothing,
so legal input can shift the positional layout and corrupt the value a parser
reads.
The value format is (8 sections):
version , serverName , tagNames/ , tagValues/ , checkpointNames/ , checkpointMs/ , measureNames/ , measureValues/
- Sections are joined by
,.
- List items are joined by
/.
Gaps in HttpClientLatencyLogEnricher:
- The section delimiter
, is never escaped. A , in any string field
(server name, tag name, tag value, checkpoint/measure name) shifts every
downstream section.
- List items do not escape
/. AppendTags, AppendCheckpoints, and
AppendMeasures append names and values raw, so a / inside an item corrupts
the item-level split.
- The server name field is not escaped at all (
AppendServerName).
Affected code
HttpClientLatencyLogEnricher
AppendServerName writes the server name raw.
AppendTags / AppendCheckpoints / AppendMeasures append names and values raw, escaping neither , nor /.
Impact
Low severity. Most fields are registered/controlled names (checkpoints, measures,
tags). The one caller-controlled field is the server application name, taken from
a response header, which can legally contain , and /. Newlines are not
reachable (rejected by the server), so this is a data-integrity / parse-corruption
issue for consumers of LatencyInfo, not a log-forging issue.
Proposed fix
Escape , and / in every string field, including the server name, matching the
scheme the incoming enricher uses (/ and , replaced with _).
Notes
Discovered during API review of #7729 (AddHttpLatencyTelemetry). The incoming
enricher had the same class of defect and was fixed in that change; this issue
tracks the remaining gap in the outgoing HttpClient enricher, which currently
escapes nothing.
Description
The outgoing HttpClient latency enricher (
AddHttpClientLatencyTelemetry)serializes the
LatencyInfotag value as a positional string but escapes nothing,so legal input can shift the positional layout and corrupt the value a parser
reads.
The value format is (8 sections):
,./.Gaps in
HttpClientLatencyLogEnricher:,is never escaped. A,in any string field(server name, tag name, tag value, checkpoint/measure name) shifts every
downstream section.
/.AppendTags,AppendCheckpoints, andAppendMeasuresappend names and values raw, so a/inside an item corruptsthe item-level split.
AppendServerName).Affected code
HttpClientLatencyLogEnricherAppendServerNamewrites the server name raw.AppendTags/AppendCheckpoints/AppendMeasuresappend names and values raw, escaping neither,nor/.Impact
Low severity. Most fields are registered/controlled names (checkpoints, measures,
tags). The one caller-controlled field is the server application name, taken from
a response header, which can legally contain
,and/. Newlines are notreachable (rejected by the server), so this is a data-integrity / parse-corruption
issue for consumers of
LatencyInfo, not a log-forging issue.Proposed fix
Escape
,and/in every string field, including the server name, matching thescheme the incoming enricher uses (
/and,replaced with_).Notes
Discovered during API review of #7729 (
AddHttpLatencyTelemetry). The incomingenricher had the same class of defect and was fixed in that change; this issue
tracks the remaining gap in the outgoing HttpClient enricher, which currently
escapes nothing.