Skip to content

GO: make the alert messages of taint-tracking queries more consistent #10413

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

Merged
merged 7 commits into from
Sep 21, 2022

Conversation

erik-krogh
Copy link
Contributor

I just did this for Ruby, Python, and JavaScript.

I'm rewriting alert messages for the taint tracking queries:

  • I tried to fit the message to the template: This path depends on a user-provided value.
  • If that didn't work I tried User-provided value flows to this location and is used in a path.

I also generally tried to use "this location" instead of "here".
I tried to formulate messages to use "depends on" and use the term "a user-provided value".

The previous change-note for changing the alert messages still cover this PR.

I'm also trying to update the style-guide based on my findings.

@github-actions github-actions bot added the Go label Sep 14, 2022
@smowton
Copy link
Contributor

smowton commented Sep 14, 2022

Mostly looks good, though I'm personally not keen on at this location or to this location, because what is a location in this context? Generally speaking we're actually saying "is passed to a logging call on this line" or similar, where neither that call nor that argument would normally be described as a "location". Given the choice between a tangly and verbose expression of what's actually happening or the imprecise "here", I prefer the latter.

@@ -24,5 +24,5 @@
// this excludes flow from safe parts of request URLs, for example the full URL when the
// doing a redirect from `http://<path>` to `https://<path>`
not scfg.hasFlow(_, sink.getNode())
select sink.getNode(), source, sink, "Untrusted URL redirection due to $@.", source.getNode(),
select sink.getNode(), source, sink, "Untrusted URL redirection depends on a $@.", source.getNode(),

Check warning

Code scanning / CodeQL

Alert message style violation

Use "flows to" instead of "depends on" in data flow queries.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

A false positive. It's a data-flow query, but the configuration includes basically all the taint-tracking steps.

@erik-krogh erik-krogh marked this pull request as ready for review September 20, 2022 20:57
@erik-krogh erik-krogh requested a review from a team as a code owner September 20, 2022 20:57
@smowton
Copy link
Contributor

smowton commented Sep 21, 2022

Does this want a change note since it might lead to alerts being considered spuriously resolved and recreated?

@erik-krogh
Copy link
Contributor Author

Does this want a change note since it might lead to alerts being considered spuriously resolved and recreated?

There is still the change-note from my previous Go PR that touched alert-messages.
So that is covered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Go no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants