Skip to content

Infinite Loop when there are multiple pages of vulnerabilities or dependencies #13

Description

@jorge-abarca

The function getPaginatedQuery in GitHubDependencies.ts enters into an infinite loop when there is another page since the cursor is updated in the variable queryParameters while graphqlParameters - used for the query - uses the variable parameters.

This issue affects repositories that have more than one page of vulnerabilities or dependencies, since both getAllVulnerabilities and getAllDependencies rely on getPaginatedQuery.

I have a PR open that addresses this, but if you don't feel comfortable with it or you are in the middle of some refactoring, please fix getPaginatedQuery. This will cause workflows to keep running until the access token expires, returning a Bad credentials error that masks the actual issue.

Here is an example of code that would address this issue:

      const graphqlParameters = buildGraphQLParameters(query, queryParameters, headers)
        , queryResult = await octokit.graphql(graphqlParameters)
      ;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions