Skip to content

carlspring/vertx-codeql-queries#14 : Implement a CodeQL query that checks for invocations of Vertx.vertx() - #15

Open
carlspring wants to merge 3 commits into
masterfrom
issues/14/vertx-vertx
Open

carlspring/vertx-codeql-queries#14 : Implement a CodeQL query that checks for invocations of Vertx.vertx()#15
carlspring wants to merge 3 commits into
masterfrom
issues/14/vertx-vertx

Conversation

@carlspring

Copy link
Copy Markdown
Owner

Pull Request Description

This pull request fixes #14 .

  • Implemented CodeQL query.
  • Implemented test case.
  • Added a query help file.

Questions

  • Does this pull request break backward compatibility?

    • No
  • Does this pull request require other pull requests to be merged first?

    • No
  • Does this require an update of the documentation?

    • No

Code Review And Pre-Merge Checklist

  • I have implemented an Insecure example.
  • I have implemented a Secure example.
  • My code follows the coding convention of this project.
  • I have performed a self-review of my own code.
  • I have commented my code in hard-to-understand areas.
  • My changes generate no new warnings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new Java CodeQL query to detect direct invocations of io.vertx.core.Vertx.vertx() and wires it into the repository’s query-test harness, along with a query help file and a sample Java file.

Changes:

  • Added InvocationOfVertxVertx.ql to flag Vertx.vertx() calls with zero arguments.
  • Added a new query-test folder (InvocationOfVertxVertx) with Maven setup, extractor options, .qlref, and expected results.
  • Added a .qhelp help file and a Java example under src/main/java.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/main/ql/InvocationOfVertxVertx.ql Implements the new query matching Vertx.vertx() calls.
src/main/ql/InvocationOfVertxVertx.qhelp Adds end-user help content for the new query.
src/main/java/org/carlspring/security/vertx/http/InvocationOfVertxVertx.java Adds a Java example that invokes Vertx.vertx().
src/test/ql/test/query-tests/InvocationOfVertxVertx/pom.xml Test-project Maven dependencies for query extraction.
src/test/ql/test/query-tests/InvocationOfVertxVertx/options Java extractor options for the query test.
src/test/ql/test/query-tests/InvocationOfVertxVertx/InvocationOfVertxVertx.qlref References the query under test.
src/test/ql/test/query-tests/InvocationOfVertxVertx/InvocationOfVertxVertx.java Finding-producing test case for Vertx.vertx().
src/test/ql/test/query-tests/InvocationOfVertxVertx/InvocationOfVertxVertx.expected Expected results for the query test run.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main/ql/InvocationOfVertxVertx.ql Outdated
Comment on lines +11 to +14
public void start()
{
Vertx.vertx();
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fixed in 2226039.

Comment on lines +7 to +11
An HTTP server which does not use SSL/TLS is vulnerable to man-in-the-middle attacks.
</p>
<p>
Please, note that it may be safe to ignore this, only if you intend your application to be placed
behind a loadbalancer, which is itself securing the connections with the appropriate certificates.
…ertx()

* Implemented CodeQL query.
* Implemented test case.
* Added a query help file.
@carlspring
carlspring force-pushed the issues/14/vertx-vertx branch from 2c798bf to 22f1191 Compare August 3, 2026 23:43
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: carlspring <1436265+carlspring@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement a CodeQL query that checks for invocations of Vertx.vertx()

3 participants