Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow only valid trace ID characters when decoding #854

Merged
merged 1 commit into from
Aug 5, 2021
Merged

Conversation

zalegrala
Copy link
Contributor

@zalegrala zalegrala commented Aug 4, 2021

Without this change, invalid characters received from the user input causes a bad error message to the user. Here we check that all of the characters that are to be decoded are valid hex characters and improve the error to the user in the event the trace ID submitted has invalid characters.

Fixes #846

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@CLAassistant
Copy link

CLAassistant commented Aug 4, 2021

CLA assistant check
All committers have signed the CLA.

@zalegrala zalegrala changed the title Trim leading or trailing space from trace ID Catch a few non-hex characters when translating trace IDs Aug 4, 2021
Copy link
Member

@kvrhdn kvrhdn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides the small note, this looks okay to me 🙂

I'm trying to find the most common invalid characters, but I'm not sure we log this somewhere...

edit: we don't log this because validation happens before logging. This will be improved when we merge the search PR.

pkg/util/http_test.go Outdated Show resolved Hide resolved
pkg/util/http.go Outdated Show resolved Hide resolved
@zalegrala zalegrala changed the title Catch a few non-hex characters when translating trace IDs Allow only valid trace ID characters when decoding Aug 4, 2021
@zalegrala zalegrala force-pushed the trimTraceID branch 3 times, most recently from c34f5a1 to 032572b Compare August 4, 2021 20:14
Without this change, invalid characters received from the user input causes a
bad error message to the user.  Here we check that all of the characters that
are to be decoded are valid hex characters and improve the error to the user in
the event the trace ID submitted has invalid characters.
@mdisibio mdisibio merged commit 5b24e3d into main Aug 5, 2021
@mdisibio mdisibio deleted the trimTraceID branch August 5, 2021 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Trace ID with extra space triggers complex error message
6 participants