4a956f6d02
Bumps the npm-dependencies group with 6 updates: | Package | From | To | | --- | --- | --- | | [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) | `6.21.0` | `7.2.0` | | [eslint](https://github.com/eslint/eslint) | `8.56.0` | `8.57.0` | | [eslint-plugin-github](https://github.com/github/eslint-plugin-github) | `4.10.1` | `4.10.2` | | [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) | `27.6.3` | `27.9.0` | | [nock](https://github.com/nock/nock) | `13.5.1` | `13.5.4` | | [typescript](https://github.com/Microsoft/TypeScript) | `5.3.3` | `5.4.2` | Updates `@typescript-eslint/parser` from 6.21.0 to 7.2.0 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.2.0/packages/parser) Updates `eslint` from 8.56.0 to 8.57.0 - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.56.0...v8.57.0) Updates `eslint-plugin-github` from 4.10.1 to 4.10.2 - [Release notes](https://github.com/github/eslint-plugin-github/releases) - [Commits](https://github.com/github/eslint-plugin-github/compare/v4.10.1...v4.10.2) Updates `eslint-plugin-jest` from 27.6.3 to 27.9.0 - [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases) - [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/jest-community/eslint-plugin-jest/compare/v27.6.3...v27.9.0) Updates `nock` from 13.5.1 to 13.5.4 - [Release notes](https://github.com/nock/nock/releases) - [Changelog](https://github.com/nock/nock/blob/main/CHANGELOG.md) - [Commits](https://github.com/nock/nock/compare/v13.5.1...v13.5.4) Updates `typescript` from 5.3.3 to 5.4.2 - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml) - [Commits](https://github.com/Microsoft/TypeScript/compare/v5.3.3...v5.4.2) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-major dependency-group: npm-dependencies - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-dependencies - dependency-name: eslint-plugin-github dependency-type: direct:development update-type: version-update:semver-patch dependency-group: npm-dependencies - dependency-name: eslint-plugin-jest dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-dependencies - dependency-name: nock dependency-type: direct:development update-type: version-update:semver-patch dependency-group: npm-dependencies - dependency-name: typescript dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-dependencies ... Signed-off-by: dependabot[bot] <support@github.com> |
||
---|---|---|
.github | ||
__tests__ | ||
dist | ||
src | ||
.eslintignore | ||
.eslintrc.json | ||
.gitignore | ||
.prettierignore | ||
.prettierrc.json | ||
.tool-versions | ||
action.yml | ||
CONTRIBUTING.md | ||
jest.config.js | ||
jest.setup.js | ||
LICENSE | ||
package-lock.json | ||
package.json | ||
README.md | ||
RELEASING.md | ||
tsconfig.json |
Gradle Wrapper Validation Action
This action validates the checksums of all Gradle Wrapper JAR files present in the repository and fails if any unknown Gradle Wrapper JAR files are found.
The action should be run in the root of the repository, as it will recursively search for any files named gradle-wrapper.jar
.
The Gradle Wrapper Problem in Open Source
The gradle-wrapper.jar
is a binary blob of executable code that is checked into nearly
2.8 Million GitHub Repositories.
Searching across GitHub you can find many pull requests (PRs) with helpful titles like 'Update to Gradle xxx'. Many of these PRs are contributed by individuals outside of the organization maintaining the project.
Many maintainers are incredibly grateful for these kinds of contributions as it takes an item off of their backlog.
We assume that most maintainers do not consider the security implications of accepting the Gradle Wrapper binary from external contributors.
There is a certain amount of blind trust open source maintainers have.
Further compounding the issue is that maintainers are most often greeted in these PRs with a diff to the gradle-wrapper.jar
that looks like this.
A fairly simple social engineering supply chain attack against open source would be contribute a helpful “Updated to Gradle xxx” PR that contains malicious code hidden inside this binary JAR.
A malicious gradle-wrapper.jar
could execute, download, or install arbitrary code while otherwise behaving like a completely normal gradle-wrapper.jar
.
Solution
We have created a simple GitHub Action that can be applied to any GitHub repository.
This GitHub Action will do one simple task:
verify that any and all gradle-wrapper.jar
files in the repository match the SHA-256 checksums of any of our official releases.
If any are found that do not match the SHA-256 checksums of our official releases, the action will fail.
Additionally, the action will find and SHA-256 hash all
homoglyph
variants of files named gradle-wrapper.jar
,
for example a file named gradlе-wrapper.jar
(which uses a Cyrillic е
instead of e
).
The goal is to prevent homoglyph attacks which may be very difficult to spot in a GitHub diff.
We created an example Homoglyph attack PR here.
Usage
Add to an existing Workflow
Simply add this action to your workflow after having checked out your source tree and before running any Gradle build:
uses: gradle/wrapper-validation-action@v2
This action step should precede any step using gradle/gradle-build-action
or gradle/actions/setup-gradle
.
Add a new dedicated Workflow
Here's a sample complete workflow you can add to your repositories:
.github/workflows/gradle-wrapper-validation.yml
name: "Validate Gradle Wrapper"
on: [push, pull_request]
jobs:
validation:
name: "Validation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2
Contributing to an external GitHub Repository
Since GitHub Actions are completely free for open source projects and are automatically enabled on almost all projects, adding this check to a project's build is as simple as contributing a PR. Enabling the check requires no overhead on behalf of the project maintainer beyond merging the action.
You can add this action to your favorite Gradle based project without checking out their source locally via the GitHub Web UI thanks to the 'Create new file' button.
Simply add a new file named .github/workflows/gradle-wrapper-validation.yml
with the contents mentioned above.
We recommend the message commit contents of:
- Title:
Official Gradle Wrapper Validation Action
- Body (at minimum):
See: https://github.com/gradle/wrapper-validation-action
From there, you can easily follow the rest of the prompts to create a Pull Request against the project.
Reporting Failures
If this GitHub action fails because a gradle-wrapper.jar
doesn't match one of our published SHA-256 checksums,
we highly recommend that you reach out to us at security@gradle.com.
Note: gradle-wrapper.jar
generated by Gradle 3.3 to 4.0 are not verifiable because those files were dynamically generated by Gradle in a non-reproducible way. It's not possible to verify the gradle-wrapper.jar
for those versions are legitimate using a hash comparison. You should try to determine if the gradle-wrapper.jar
was generated by one of these versions before running the build.
If the Gradle version in gradle-wrapper.properties
is out of this range, you may need to regenerate the gradle-wrapper.jar
by running ./gradlew wrapper
. If you need to use a version of Gradle between 3.3 and 4.0, you can use a newer version of Gradle to generate the gradle-wrapper.jar
.
If you're curious and want to explore what the differences are between the gradle-wrapper.jar
in your possession
and one of our valid release, you can compare them using this online utility: diffoscope.
Regardless of what you find, we still kindly request that you reach out to us and let us know.
Resources
To learn more about verifying the Gradle Wrapper JAR locally, see our guide on the topic.