Repository navigation
fix(packages): pin every AVR framework archive checksum, fix dead ATTinyCore URL - #2130
Merged
Merged
Conversation
`avr_frameworks.json` is the production resolution path for AVR boards, and 8 of its 14 entries carried `"checksum": null`, so ATTinyCore, Digistump (tiny/pro), MiniCore, megaTinyCore, MegaCoreX and ArduinoCore-megaavr were unpacked with no integrity check. Pin all six distinct archives (sha256 computed today from the exact URL `framework_url()` builds, each verified to contain its declared `validation_path`) and add a guard test so a new entry cannot land unpinned. Also: - `attiny_core.rs` hard-coded `.../refs/tags/v1.5.2.tar.gz`, but ATTinyCore's release tag is `1.5.2` with no `v`: that URL 404s. The module has no production caller today (ATTiny resolves through the JSON), so this was a landmine rather than a live outage. Fixed and pinned. - `ensure_arduino_api` bypasses `PackageBase` and downloaded with no checksum at all; it now verifies the pinned archive before extraction. Refs #2128 (bucket uploads and the GitHub prefix allowlist there remain maintainer decisions).
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
14 of 17 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pins SHA-256 on every AVR framework archive in
assets/avr_frameworks.json(theproduction resolution path for AVR boards, not a latent module), fixes a dead
ATTinyCore URL, and puts an integrity gate in front of the one-shot
ArduinoCore-API fetch. Tracking issue: #2128 (leftover audit from #2029). That
issue stays open — the bucket-upload and prefix-allowlist items are maintainer
decisions, listed at the bottom.
Why this is the production gap
#2128readavr_frameworks.jsonas data but only listed Rust constants. TheJSON is what
AvrFramework::for_coreactually consumes: 14 entries, of which8 had
"checksum": null, so those cores' archives were unpacked with nointegrity check at all. The six distinct archives, each downloaded today from
the exact URL
framework_url()builds and each verified to contain its ownvalidation_path:tiny,tinymoderne3b94d9f…5d36ddtiny,pro5bfd9a89…cd1cbMiniCore5f5084ea…443c6megatinycoreb1ada43f…bf634MegaCoreX267b4ff6…45b7barduino_megaavr81d0e831…405c1With this change all 14 entries are pinned, and
every_registry_entry_is_checksum_pinnedkeeps it that way.Also fixed: the ATTinyCore module's URL was 404
crates/fbuild-library/src/library/attiny_core.rshard-coded…/refs/tags/v1.5.2.tar.gz. ATTinyCore's release tag is1.5.2— nov(releases are 1.5.2 / 1.5.1 / 1.5.0; only the old 1.0.x/1.1.x tags carry one), so
that URL answered
HTTP 404. The module has no production caller today(ATTiny resolves through
avr_frameworks.json, which was already correct), sothis was a landmine rather than a live outage — but it would fail every install
the moment anything used it. Fixed, and pinned, with a test that asserts both
constants exactly.
Also: ArduinoCore-API had no checksum at all
ensure_arduino_apibypassesPackageBase: it downloads, writes, extracts. Itnow verifies the archive (
2c76d4dc…bfa57, 68,441 bytes) before extraction.Tests cover the rejection path (
checksum mismatch) and that the gate comparesrather than always failing.
Not in this PR
downloads.arduino.cc,files.seeedstudio.com,www.teknic.com, ARM 14.2.rel1 darwin-x86_64) — maintainer approval.rp2040_core,esp8266_framework,apollo3_core,stm32_core,arduino_mbed_core,silabs_core) — same class,each needs its own archive download + pin; next pass.
Tests
TMPDIR=/home/niteris/t soldr cargo test -p fbuild-library --lib— see thecheck-runs; the new tests are
test_url_and_checksum_are_pinned,test_constructor_carries_the_checksum(attiny), the same pair plustest_verify_archive_rejects_unpinned_bytes/test_verify_archive_accepts_the_pinned_digest(arduino_api), andevery_registry_entry_is_checksum_pinned(registry).