The Wayback Machine - https://web.archive.org/web/20220324051455/https://github.com/github/codeql/pull/8461
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

Add query for double-fetch vulnerability #8461

Merged
merged 8 commits into from Mar 23, 2022
Merged

Conversation

Paul1nh0
Copy link
Contributor

@Paul1nh0 Paul1nh0 commented Mar 16, 2022

Add query for double-fetch vulnerability CVE-2016-6480

@jketema
Copy link
Contributor

@jketema jketema commented Mar 16, 2022

Hi @Paul1nh0,

Thanks for your PR. Unfortunately, this query seems to be a direct copy of this one: https://github.com/github/codeql/pull/8423/files#diff-c5a2ba137e4023d259d6e72897f1842088760b77f799d5ef7f4344e01b54ec38 which was submitted about an hour before yours. Are you aware of this?

@Paul1nh0
Copy link
Contributor Author

@Paul1nh0 Paul1nh0 commented Mar 16, 2022

Hello jketema,

Because I'm not that familiar with pulling request, I commit this https://github.com/github/codeql/pull/8423/files#diff-c5a2ba137e4023d259d6e72897f1842088760b77f799d5ef7f4344e01b54ec38 by mistake:(

So I change another github accout(this one)to create pull request again:(

@Paul1nh0
Copy link
Contributor Author

@Paul1nh0 Paul1nh0 commented Mar 16, 2022

Hi @Paul1nh0,

Thanks for your PR. Unfortunately, this query seems to be a direct copy of this one: https://github.com/github/codeql/pull/8423/files#diff-c5a2ba137e4023d259d6e72897f1842088760b77f799d5ef7f4344e01b54ec38 which was submitted about an hour before yours. Are you aware of this?

Hi @Paul1nh0,

Thanks for your PR. Unfortunately, this query seems to be a direct copy of this one: https://github.com/github/codeql/pull/8423/files#diff-c5a2ba137e4023d259d6e72897f1842088760b77f799d5ef7f4344e01b54ec38 which was submitted about an hour before yours. Are you aware of this?

In breif, cve-2017-5123.ql and cve-2016-6480.ql are all written by myself. I created pull request for cve-2017-5123.ql the day before yesterday, but I commit a new file cve-2016-6480.ql in the same pull request, which I'd intented to commit in a new pull request.

@jketema
Copy link
Contributor

@jketema jketema commented Mar 16, 2022

Hi @Paul1nh0,

Please understand that there's no way for me to check that your account belongs to the same individual as the one who opened the other PR. Could you leave a note while logged into to the account that made #8423 that acknowledges what you're saying? Thanks.

Also, please find a way of removing the CVE-2016-6480 query from the other PR.

@Paul1nh0
Copy link
Contributor Author

@Paul1nh0 Paul1nh0 commented Mar 17, 2022

Hi @Paul1nh0,

Please understand that there's no way for me to check that your account belongs to the same individual as the one who opened the other PR. Could you leave a note while logged into to the account that made #8423 that acknowledges what you're saying? Thanks.

Also, please find a way of removing the CVE-2016-6480 query from the other PR.

OK, I'll try to delete cve_2016_6480.ql in that commit:(

@4B5F5F4B
Copy link

@4B5F5F4B 4B5F5F4B commented Mar 17, 2022

Hi @Paul1nh0,

Please understand that there's no way for me to check that your account belongs to the same individual as the one who opened the other PR. Could you leave a note while logged into to the account that made #8423 that acknowledges what you're saying? Thanks.

Also, please find a way of removing the CVE-2016-6480 query from the other PR.

Hello, I've deleted it d4c7314

@jketema
Copy link
Contributor

@jketema jketema commented Mar 17, 2022

Hi @Paul1nh0 @4B5F5F4B

Thanks for clearing things up!

Copy link
Contributor

@MathiasVP MathiasVP left a comment

Thanks for your contribution, @Paul1nh0!

Here's my first round of comments. In addition to the changes/comments I've requested, I'd also appreciate it if you could:

  • Restructure your contribution so that your query is located in a CWE directory instead of a CVE directory. Looking at https://access.redhat.com/security/cve/cve-2016-6480 it sounds like this particular CVE is an instance of CWE-362. So would you mind moving your query into a new cpp/ql/experimental/Security/CWE/CWE-362 directory?
  • Format your query so that it adheres to our formatting guidelines. You can see the style guidelines here. It also contains a link that describes how to autoformat your query so that it automatically adheres to our requirements.

cpp/ql/src/experimental/Security/CVE/cve-2016-6480.ql Outdated Show resolved Hide resolved
cpp/ql/src/experimental/Security/CVE/cve-2016-6480.ql Outdated Show resolved Hide resolved
cpp/ql/src/experimental/Security/CVE/cve-2016-6480.ql Outdated Show resolved Hide resolved
cpp/ql/src/experimental/Security/CVE/cve-2016-6480.ql Outdated Show resolved Hide resolved
cpp/ql/src/experimental/Security/CVE/cve-2016-6480.ql Outdated Show resolved Hide resolved
@MathiasVP
Copy link
Contributor

@MathiasVP MathiasVP commented Mar 21, 2022

In addition, I should also note that if you plan on participating in the bug bounty program, you should also add tests (that demonstrate that your query is working) and a qhelp file (that describes the vulnerability and the mitigation). You can read about these here: https://github.com/github/codeql/blob/main/CONTRIBUTING.md.

Note that tests and qhelp aren't strictly necessary, but they'll improve the final score we assign to your submission if you choose to participate in the bug bounty program.

@MathiasVP
Copy link
Contributor

@MathiasVP MathiasVP commented Mar 22, 2022

CI is failing because the query isn't autoformatted:

ql/cpp/ql/src/experimental/Security/CWE/CWE-362/double-fetch.ql would change by autoformatting.

@Paul1nh0
Copy link
Contributor Author

@Paul1nh0 Paul1nh0 commented Mar 22, 2022

CI is failing because the query isn't autoformatted:

ql/cpp/ql/src/experimental/Security/CWE/CWE-362/double-fetch.ql would change by autoformatting.

Hello @MathiasVP , I'm sorry but I have no idea about what you mean by autoformatted?

@MathiasVP
Copy link
Contributor

@MathiasVP MathiasVP commented Mar 22, 2022

Hello @MathiasVP , I'm sorry but I have no idea about what you mean by autoformatted?

See my response here:

Format your query so that it adheres to our formatting guidelines. You can see the style guidelines here. It also contains a link that describes how to autoformat your query so that it automatically adheres to our requirements.

Paul1nh0 added 2 commits Mar 23, 2022
As far as I can tell, root cause of double-fetech issue is read from the same user mode memory twice, so it makes sense that only check whether user mode pointer is same or not
Copy link
Contributor

@MathiasVP MathiasVP left a comment

Thanks for fixing all my concerns. Looks good to me now!

@MathiasVP MathiasVP merged commit 61c9442 into github:main Mar 23, 2022
6 checks passed
@Paul1nh0
Copy link
Contributor Author

@Paul1nh0 Paul1nh0 commented Mar 24, 2022

Thanks for fixing all my concerns. Looks good to me now!

Hello @MathiasVP ,

I’m so excited that I can make a little contribution to CodeQL with your help, thank you. What a great hacking journey:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants