Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Conversation

@ghost
Copy link

@ghost ghost commented Apr 22, 2020

This adds a query for Email content injection issues.
It models the Golang's net/smtp library as well as the Sendgrid library (581 stars)

I am still working on the tests and documentation. I will add those soon. But I would still like a review until then.

@@ -0,0 +1,16 @@
/**
* @name Email content injection
* @description This query tests for Email content injection ie. instances where a
Copy link
Contributor

Choose a reason for hiding this comment

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

ie. should probably be i.e. (id est = that is)

Copy link
Contributor

Choose a reason for hiding this comment

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

We generally prefer not to use abbreviations like "i.e." or "e.g." at all. It is almost always clearer to use a spelled-out alternative like "that is" or "for example" instead.

@ghost ghost marked this pull request as ready for review April 24, 2020 21:29
@ghost
Copy link
Author

ghost commented Apr 24, 2020

I have added tests and necessary documentation. This can now be reviewed and merged.

Copy link
Contributor

@max-schaefer max-schaefer left a comment

Choose a reason for hiding this comment

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

Thank you very much for your contribution! Here is an initial batch of comments, I'm planning to take a more thorough look at a later time.

Have you run this query on any projects on LGTM.com yet?

Copy link
Contributor

@max-schaefer max-schaefer left a comment

Choose a reason for hiding this comment

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

Here are a few more detailed comments, overall this looks very nice!

We'll evaluate it on LGTM.com and @sauyon can help you with auto-stubbing the libraries the tests depend on.

* Extend this class to refine existing API models. If you want to model new APIs,
* extend `MailData::Range` instead.
*/
class MailData extends DataFlow::Node {
Copy link
Author

Choose a reason for hiding this comment

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

I have removed the Function suffix and renamed this as MailData.

@max-schaefer
Copy link
Contributor

The evaluation came back reasonable. I'll leave it up to you whether you want to address the false negative we discussed on Slack. Other than that, I think the only thing that's missing is replacing the manually created dependency stubs with auto-generated ones, which @sauyon can take care of.

Copy link
Contributor

@sauyon sauyon 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. A few comments. The commit with test stubs is ready to be pushed whenever you'd like.

@sauyon
Copy link
Contributor

sauyon commented May 1, 2020

Hm, sorry about the comment spam and then deletion; GitHub helpfully had comments from before staged and didn't show them to me in the review screen because they were outdated.

This adds a query for Email content injection issues.
It models the Golang's net/smtp library as well as
the Sendgrid email library (581 stars).
@ghost
Copy link
Author

ghost commented May 1, 2020

I have updated the module name as well as the corresponding qldoc. I have squashed all the commits into one and rebased the branch on origin/master for final merge.

@ghost
Copy link
Author

ghost commented May 1, 2020

@max-schaefer , I am trying to model the io package for #109 to work correctly. I think with those changes, the false negative would be fixed.

@sauyon
Copy link
Contributor

sauyon commented May 1, 2020

I've taken this opportunity to push the stub commit.

@max-schaefer max-schaefer merged commit 657108d into github:master May 4, 2020
@ghost ghost deleted the EmailInjection branch May 4, 2020 22:09
@max-schaefer max-schaefer added the needs-polishing An external contribution that may need follow-up work. label May 12, 2020
@max-schaefer max-schaefer removed the needs-polishing An external contribution that may need follow-up work. label May 22, 2020
owen-mc pushed a commit to owen-mc/codeql-go that referenced this pull request Jun 10, 2020
This adds a query for Email content injection issues.
It models the Golang's net/smtp library as well as
the Sendgrid email library (581 stars).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants