Repository navigation
Conversation
…acters Escape diagnostic text per position as the InfluxDB line protocol requires: commas and spaces in measurements, commas/equals/spaces in tag keys, tag values and field keys, and quotes/backslashes in string field values. Newlines are dropped because a newline ends a point and cannot be escaped. Non-finite numeric-looking values are written as quoted strings. Adds regression tests. Not built or run against a real package; source review only. Signed-off-by: Ugur Celik (ucsurf) <337280806+ucsurf@users.noreply.github.com>
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.
Hello maintainers,
Thanks for diagnostic_remote_logging. While reading influx_line_protocol.hpp at 33029d0 (ros2 branch, v4.5.7, 2026-11-04) we noticed a robustness issue in how diagnostic text is written to InfluxDB. This was found by source review only; nothing was built or run against an InfluxDB server, and the line-protocol behaviour below comes from the published InfluxDB line-protocol spec.
What happens
Why it matters
Ordinary text such as a message with a quote, or a hardware_id like "dev,rev=2", can produce a line InfluxDB rejects. InfluxDB rejects whole write batches that contain invalid lines, so one odd status can stop the other diagnostics in that batch from being recorded. It can also make a point land with different tags or fields than intended. Diagnostics text often comes from third-party drivers, so this is worth making robust. We think it is a correctness and hardening fix, not a security report.
Fix (this PR)
Escape per position per the spec, with separate helpers for measurement, tag/field-key and quoted-string-value; drop newlines (they cannot be escaped in line protocol); and treat non-finite numeric-looking values as quoted strings. The change touches influx_line_protocol.hpp and test/influx_line_protocol.cpp (regression tests added). It applies cleanly at 33029d0 (ros2 HEAD) and passes git apply --check. The header was only stub-compiled by us; the full package and tests have not been built or run, so please let CI confirm. Behaviour changes to be aware of: newlines in diagnostic text are dropped, and nan/inf-like values become quoted strings.
Credit: Ugur Celik (ucsurf), @ucsurf
— Ugur Celik (ucsurf) · https://uc.surf
We find and report security issues in open source before attackers do. If our work helped you, a small contribution keeps it going and makes the internet a little safer for everyone:
https://buymeacoffee.com/ucsurf