Skip to content

🔨 Verify Gradle wrapper and dependency checksums - #54

Merged
Miyamura80 merged 15 commits into
mainfrom
claude/festive-cori-e6o9o8
Nov 2, 2026
Merged

Miyamura80 merged 15 commits into
mainfrom
claude/festive-cori-e6o9o8

Conversation

@Miyamura80

@Miyamura80 Miyamura80 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The Android build (CI and release.yml, which ships the APK) downloaded Gradle and every Maven/Google dependency trusting TLS alone. CVE-2026-91403 (distrusted eMudhra intermediates in the JDK trust store) is exactly the kind of flaw that breaks that. This pins everything by sha256 so a forged certificate can no longer swap code into the APK, regardless of the JDK patch level.

Changes

  • gradle/wrapper/gradle-wrapper.properties: distributionSha256Sum for Gradle 9.5.0.
  • gradle/verification-metadata.xml: sha256 for all 454 components resolved by assembleDebug testDebugUnitTest lintDebug, generated in CI (the sandbox can't reach Google/Gradle hosts).
  • .github/workflows/gradle-verification.yml: manual workflow_dispatch job to regenerate the metadata after a dependency bump. Dependabot Gradle PRs will now fail CI until someone runs it on the bump's branch and commits the result.
  • CLAUDE.md: one line on the above.

Testing

  • Build passes (./gradlew assembleDebug)
  • Unit tests pass (./gradlew testDebugUnitTest)
  • Lint passes (./gradlew lintDebug)

(All three run in the Android CI check on this PR, now with verification enforced.)

Related Issues

None.


Generated by Claude Code


Summary by cubic

Pins the Gradle wrapper distribution and all 454 resolved dependencies by sha256 so a forged TLS certificate can no longer swap code into the APK (e.g. CVE-2026-91403). Verification is enforced in every CI build; dependency bumps (including Dependabot's) will fail until the metadata is regenerated.

Migration

Run the new "Regenerate Gradle verification metadata" workflow (workflow_dispatch) on the bump's branch and commit the resulting gradle/verification-metadata.xml. Wrapper upgrades also require updating distributionSha256Sum in gradle/wrapper/gradle-wrapper.properties.

Written for commit e3bab8a. Summary will update on new commits.

View guided diff Turn on auto-fix

claude added 14 commits October 25, 2026 13:39
Every GitHub Actions `uses:` is now pinned to a 40-character commit sha with
the human-readable tag kept as a comment. Each sha was resolved from the tag
and independently verified, so a moved or rewritten tag can no longer swap in
different code.

- actions/checkout v4 and actions/upload-artifact v4 run on the end-of-life
  node20 runtime; they move to v6.1.0 and v7.0.2 (inputs unchanged).
- tools/check_immutable_refs.py fails if any Dockerfile or workflow uses a
  mutable image tag or action ref; it runs in the new "Pinned refs" workflow
  on every pull request and push to main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wtx3dU8PQvgyubf6ZpNaG3
The guard now clears a pin-exempt at a blank line, joins continuation
lines like Docker (honouring a `# escape=` directive), requires a bare
or docker:// runs.image to be pinned, reads flow-style and spaced YAML
keys, checks every ref on a line and requires owner/repo@<sha>. On pull
requests the workflow runs the base branch's copy of the checker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wtx3dU8PQvgyubf6ZpNaG3
FROM now resolves only global ARGs (declared before the first FROM), and
each stage starts empty, seeing a global value only by redeclaring it
without a default, so a pinned stage-level ARG can no longer mask a
mutable global default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wtx3dU8PQvgyubf6ZpNaG3
`ARG NAME=` now sets the value to "" instead of leaving an earlier
default in place, so the empty value fails closed as untagged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wtx3dU8PQvgyubf6ZpNaG3
Continuation lines of an open `{ ... }` / `[ ... ]` keep flow-style
parsing, so `uses:` after another key on such a line is checked, and a
`*version:` whose value `latest` starts on the next line is flagged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wtx3dU8PQvgyubf6ZpNaG3
A `*version:` key inside a flow collection whose value starts on the
next line is now checked too, and comment lines before the value are
skipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wtx3dU8PQvgyubf6ZpNaG3
…blowup

- An anchor or tag before a block key (`- &step uses: x`, `- !!str uses: x`,
  `{ &k uses: x }`) no longer hides the key from the check.
- Verbatim tags with commas (`!<tag:yaml.org,2002:seq> [...]`) now open a
  flow collection.
- Each node property must end at whitespace or a bracket, so a run like
  `&&&&x` has one split instead of exponentially many (the old pattern hung
  on 30 characters).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wtx3dU8PQvgyubf6ZpNaG3
`!<[^>]*>` ran to the end of the line from every comma when the tag was
never closed, so a flow line of repeated `,!<` was quadratic (32k repeats
took 8s). YAML verbatim tags hold URI characters only, so the tag now
stops at whitespace or another `<`; the same line takes 0.04s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wtx3dU8PQvgyubf6ZpNaG3
`bun-version: &v latest` (and `&v` with `latest` on the next line) slipped
past the `latest` check because the value was taken to be `&v`, and
`uses: &pin owner/repo@<sha>` was wrongly rejected for the same reason.
Node properties after the colon are now skipped before the value is read,
on the key's own line and on the line below it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wtx3dU8PQvgyubf6ZpNaG3
`container: &c` followed by `{ image: <pinned> }` on the next line was
read as a scalar image and rejected. A continuation that opens a `{` or
`[` collection is now left to the per-line flow scanner, which already
checks the keys inside it, so a mutable image there is still flagged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wtx3dU8PQvgyubf6ZpNaG3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wtx3dU8PQvgyubf6ZpNaG3
Pin the Gradle 9.5.0 distribution by sha256 and add dependency verification
metadata, so a forged TLS certificate (e.g. CVE-2026-91403, distrusted eMudhra
intermediates in the JDK trust store) cannot swap a dependency into the APK.
Turns the bootstrap workflow into a manual job for regenerating the metadata
after dependency bumps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wtx3dU8PQvgyubf6ZpNaG3
@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@cubic-dev-ai cubic-dev-ai Bot 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.

No issues found across 3 files

Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.

View guided diff | Turn on auto-fix | Re-trigger cubic

@Miyamura80
Miyamura80 merged commit bdad469 into main Nov 2, 2026
4 checks passed
@github-actions
github-actions Bot deleted the claude/festive-cori-e6o9o8 branch November 2, 2026 07:29
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.

2 participants