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

fix: escape use input in debug route #1299

Merged
merged 3 commits into from
Aug 26, 2024
Merged

Conversation

TylerHelmuth
Copy link
Contributor

Which problem is this PR solving?

  • The debug endpoint doesn't sanitize the user input before using it in the response.

Short description of the changes

  • use html.EscapeString to escape the user's input string for use in refinery and the response.

@TylerHelmuth TylerHelmuth requested a review from a team as a code owner August 22, 2024 21:52
Copy link
Contributor

@kentquirk kentquirk left a comment

Choose a reason for hiding this comment

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

Sadly, you can't put it here, because it might calculate the wrong shard destination for the trace. You need to move the EscapeString call to be around the traceID in the sprintf and not affect the shard calculation.

@TylerHelmuth
Copy link
Contributor Author

@kentquirk updated

Copy link
Contributor

@kentquirk kentquirk left a comment

Choose a reason for hiding this comment

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

LGTM

@TylerHelmuth TylerHelmuth merged commit ea810a5 into main Aug 26, 2024
5 checks passed
@TylerHelmuth TylerHelmuth deleted the tyler.escape-debug-route-input branch August 26, 2024 17:09
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.

2 participants