Skip to content

Conversation

@usmansaleem
Copy link
Member

@usmansaleem usmansaleem commented Nov 25, 2025

PR description

Add Dependency Check Gradle plugin. See https://dependency-check.github.io/DependencyCheck/dependency-check-gradle/index.html for configuration details.

This PR supersedes #9155

Run dependency checks on all modules:

./gradlew dependencyCheckAggregate

The reports should be available in build/dependency-check directory of each module.

NVD API Key Highly Recommended

This task uses NVD API. It is highly encouraged to obtain an NVD API Key; see https://nvd.nist.gov/developers/request-an-api-key Without an NVD API Key dependency-check's updates will be extremely slow. Export NVD_API_KEY environment variable with appropriate key before running this task.


  • TODO via separate PR: Integrate in Github workflow, possibly as a nightly job and as a pre-req of release job. Upload SARIF file via https://github.com/github/codeql-action/tree/v4/upload-sarif so that the changes are visible in Security tab.

  • TODO via separate PR: Fix reported vulnerabilities - if any.

@usmansaleem usmansaleem marked this pull request as ready for review November 25, 2025 07:28
Copilot AI review requested due to automatic review settings November 25, 2025 07:28
@usmansaleem usmansaleem self-assigned this Nov 25, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

nvd.apiKey = System.getenv('NVD_API_KEY')
failBuildOnCVSS = 7 // Fail on high CVSS severity
suppressionFile = "${rootDir}/gradle/owasp-suppression.xml"
formats = ['HTML', 'SARIF']
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the sarif format needed for?

Copy link
Member Author

Choose a reason for hiding this comment

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

SARIF format can be uploaded via GitHub action so that it appears in the "Security" tab.

@macfarla macfarla mentioned this pull request Nov 27, 2025
10 tasks
id 'org.web3j.solidity' version '0.6.0'
}

// Force all web3j dependencies to use version 4.14.0 as it incorrectly pulls in 7.3.2
Copy link
Contributor

Choose a reason for hiding this comment

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

which dependency is pulling in 7.3.2?

Copy link
Member Author

Choose a reason for hiding this comment

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

@fab-10 After introducing owasp dependency check plugin, it attempts to perform configuration analysis to determine all the jars which will be used by a module, this somehow results in web3j plugin to request a non-existent web3j core libraries version, such as 7.3.2. This is probably a bug in web3j plugin or in owasp plugin, however,the debug logs simply shows that shanghai module is requesting web3j core 7.3.2 and it doesn't exist in maven, hence the build errors out. Overriding like above solves the issue.

Comment on lines 5 to 9
<notes><![CDATA[
file name: dataflow-errorprone-3.42.0-eisop4.jar (shaded: com.google.guava:guava:30.1.1-jre)
This file is part of errorprone which is used at build time. This is not part of the runtime dependencies.
]]></notes>
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure if it safe to suppress a check only because that code run only during the build time, it should depends on the specific vulnerability, because for example it could be that a vulnerability changes some source file and thus leak into runtime

Copy link
Member Author

Choose a reason for hiding this comment

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

Fair point, We can try to override the fixed version of this library. I believe this library is resolved by the errorprone plugin during the build time.

// when updating web3j versions, also update plugin and config resolution in:
// - acceptance-tests/tests/shanghai/build.gradle
// - acceptance-tests/tests/build.gradle
api 'org.web3j:abi:4.14.0'
Copy link
Contributor

Choose a reason for hiding this comment

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

is this Web3J update required to be part of this PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

No it doesn't. I am going to revert it to previous version.

Copy link
Contributor

@fab-10 fab-10 left a comment

Choose a reason for hiding this comment

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

Before going on we should understand why adding the dependency check plugin should not interfere with web3j resolution

@macfarla
Copy link
Contributor

macfarla commented Dec 2, 2025

Before going on we should understand why adding the dependency check plugin should not interfere with web3j resolution

I asked in web3j discord, they had no clues https://discord.com/channels/905194001349627914/1195062053682032700/1435244486358990919

@usmansaleem usmansaleem marked this pull request as draft December 2, 2025 23:13
@usmansaleem
Copy link
Member Author

Converted to draft. Will try to isolate the problem in a very simple project involving owasp plugin, web3j plugin and verification metadata enabled. @macfarla @fab-10

@github-project-automation github-project-automation bot moved this to Backlog in RC 25.12.0 Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Open PRs

Development

Successfully merging this pull request may close these issues.

4 participants