Skip to content

PY: change alert messages of path queries to use the same template #10252

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 2 commits into from
Sep 5, 2022

Conversation

erik-krogh
Copy link
Contributor

@erik-krogh erik-krogh commented Sep 1, 2022

I tried to rewrite 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.

@erik-krogh erik-krogh added the WIP This is a work-in-progress, do not merge yet! label Sep 1, 2022
@github-actions github-actions bot added the Python label Sep 1, 2022
@erik-krogh erik-krogh force-pushed the py-followMsg branch 4 times, most recently from 73cdf9f to 953cc1a Compare September 2, 2022 06:05
@erik-krogh erik-krogh removed the WIP This is a work-in-progress, do not merge yet! label Sep 2, 2022
@erik-krogh erik-krogh marked this pull request as ready for review September 2, 2022 12:49
@erik-krogh erik-krogh requested a review from a team as a code owner September 2, 2022 12:49
@erik-krogh erik-krogh added no-change-note-required This PR does not need a change note ready-for-doc-review This PR requires and is ready for review from the GitHub docs team. labels Sep 2, 2022
@martin389
Copy link

Hello from this week's docs first responder 👋 Thanks for the ping! I've added this PR to our review board for another writer to look at. They'll be able to advise on any additional considerations for this change.

Copy link
Contributor

@tausbn tausbn left a comment

Choose a reason for hiding this comment

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

One comment/suggestion, otherwise these all look good to me. 👍

Comment on lines 22 to 23
select sink.getNode(), source, sink, "This value modification depends on a $@.", source.getNode(),
"default value"
Copy link
Contributor

Choose a reason for hiding this comment

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

This one sounds a bit strange to me ("'value modification'? What's that?"), but I couldn't come up with a better phrasing.

Also, "depends on a default value" seems too weak of a statement to me. It not only depends on a default value, it actively mutates said default value.

Edit: Perhaps "This expression mutates a default value." would be better?

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, s/mutates/modifies/ might be even better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, "depends on a default value" seems too weak of a statement to me. It not only depends on a default value, it actively mutates said default value.

You're right, it's a DataFlow::Configuration and not a TaintTracking::Configuration, so depends is too weak a statement.
"This expression mutates a default value" sounds good to me 👍

Copy link
Contributor

@felicitymay felicitymay left a comment

Choose a reason for hiding this comment

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

As I mentioned in a comment, I'm rather rusty on select statements.

Assuming that I'm reading these correctly, these changes look clearer to me ✨

Comment on lines +25 to +26
select sink.getNode(), source, sink, "This path depends on $@.", source.getNode(),
"a user-provided value"
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm rather rusty on how these select statements look in results. Am I right to think that this is shown as:

This path depends on a user-provided value.

If so, this looks good to me 👍🏻

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep, that's right!

@erik-krogh erik-krogh merged commit 1fe9b3f into github:main Sep 5, 2022
RasmusWL added a commit to RasmusWL/codeql that referenced this pull request Sep 6, 2022
This partly reverts the changes from github#10252

Although consistency is nice, the new messages didn't sound as natural.

New alert message would read

> Insecure hashing algorithm (md5) depends on sensitive data (password). (...)

I'm not sure what it means that a hashing algorithm depends on data. So
for me, the original text below is much easier to understand.

> Sensitive data (password) is used in a hashing algorithm (md5) that is insecure (...)

Same goes for the other sensitive data queries.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-change-note-required This PR does not need a change note Python ready-for-doc-review This PR requires and is ready for review from the GitHub docs team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants