Skip to content

[Go]: Add support of github.com/jackc/pgx and related packages #481

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

Closed
japroc opened this issue Nov 15, 2021 · 6 comments
Closed

[Go]: Add support of github.com/jackc/pgx and related packages #481

japroc opened this issue Nov 15, 2021 · 6 comments
Labels
All For One Submissions to the All for One, One for All bounty

Comments

@japroc
Copy link

japroc commented Nov 15, 2021

Query

Link to pull request with your CodeQL query:

Relevant PR: github/codeql-go#607

CVE ID(s)

List the CVE ID(s) associated with this vulnerability. GitHub will automatically link CVE IDs to the GitHub Advisory Database.

  • no CVEs

Report

Describe the vulnerability. Provide any information you think will help GitHub assess the impact your query has on the open source community.

The idea of this PR is to improve default SqlInjection.ql query by adding github.com/jackc/pgx module and related.

I basically reused existing SqlInjection.ql query, and created a custom PgxSqlInjection.ql query. The CodeQL custom module with implements pgx sql argument is defined in Pgx.qll file. I think that pgx support should be implemented by extending SQL::QueryString.

When this module will be moved from experimental folder to standart library, it would automatically improve existing Sqlnjection.ql query. But for now, for a demonstration, i created a separate query which imports experimental module and repeats standart query. I also added snippet for pgx usage and qhelp.

  • [x ] Are you planning to discuss this vulnerability submission publicly? (Blog Post, social networks, etc). We would love to have you spread the word about the good work you are doing

Result(s)

Provide at least one useful result found by your query, on some revision of a real project.

I have made a series of queries using lgtm.com.
There are findings:

https://lgtm.com/query/4453866281735326417/

  • Alex-Kuz/tp-database
  • averageflow/joes-warehouse
  • cauli/mulungu

https://lgtm.com/query/2344985243544414322/

  • fhirbase/fhirbase
  • flynn/flynn
  • hackfeed/remrratality
  • hasura/pgdeltastream

https://lgtm.com/query/3110488658498384350/

  • huvalk/tech-db-huvalk
  • just1689/pg-gateway
  • krok-o/krok
  • mysteriumnetwork/discovery
@japroc japroc added the All For One Submissions to the All for One, One for All bounty label Nov 15, 2021
@JarLob
Copy link
Contributor

JarLob commented Nov 16, 2021

Hi @japroc,
In order to be eligible for bounty your query must find at least one CVE that was not previously found by an existing query, in a released version (older releases are also permitted) of an open source project that is actually used (no demo, training, vulnerable on purpose).

@antonio-morales
Copy link
Contributor

Hi @japroc,

any updates on this?

@japroc
Copy link
Author

japroc commented Feb 17, 2022

Hi antonio-morales,

I faced some problems with writing tests. And completely forgot about that issue :)
Let me few days. I will make one more try on writing tests on the upcoming weekends. And also try to find some CVEs. Thanks.

@JarLob
Copy link
Contributor

JarLob commented Apr 11, 2022

Do you have an update?

@JarLob
Copy link
Contributor

JarLob commented Aug 13, 2022

I'm closing the issue, but feel free to open it again if you have updates on it.

@JarLob JarLob closed this as completed Aug 13, 2022
@ghsecuritylab
Copy link
Collaborator

Your submission is now in status Closed.

For information, the evaluation workflow is the following:
Initial triage > Test run > Results analysis > Query review > Final decision > Pay > Closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
All For One Submissions to the All for One, One for All bounty
Projects
None yet
Development

No branches or pull requests

4 participants