Skip to content

fix(packages): pin every AVR framework archive checksum, fix dead ATTinyCore URL - #2130

Merged
zackees merged 1 commit into
mainfrom
agent/attiny-sha-pins
Nov 21, 2026
Merged

zackees merged 1 commit into
mainfrom
agent/attiny-sha-pins

Conversation

@zackees

@zackees zackees commented Nov 21, 2026

Copy link
Copy Markdown
Member

Pins SHA-256 on every AVR framework archive in assets/avr_frameworks.json (the
production 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

#2128 read avr_frameworks.json as data but only listed Rust constants. The
JSON is what AvrFramework::for_core actually consumes: 14 entries, of which
8 had "checksum": null, so those cores' archives were unpacked with no
integrity check at all. The six distinct archives, each downloaded today from
the exact URL framework_url() builds and each verified to contain its own
validation_path:

entries archive bytes sha256
tiny, tinymodern ATTinyCore 1.5.2 20,420,559 e3b94d9f…5d36d
dtiny, pro DigistumpArduino 1.7.2 48,048,308 5bfd9a89…cd1cb
MiniCore MiniCore v2.2.2 930,518 5f5084ea…443c6
megatinycore megaTinyCore 2.6.11 12,846,485 b1ada43f…bf634
MegaCoreX MegaCoreX v1.1.5 323,584 267b4ff6…45b7b
arduino_megaavr ArduinoCore-megaavr 1.8.8 909,887 81d0e831…405c1

With this change all 14 entries are pinned, and
every_registry_entry_is_checksum_pinned keeps it that way.

Also fixed: the ATTinyCore module's URL was 404

crates/fbuild-library/src/library/attiny_core.rs hard-coded
…/refs/tags/v1.5.2.tar.gz. ATTinyCore's release tag is 1.5.2 — no v
(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), so
this 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_api bypasses PackageBase: it downloads, writes, extracts. It
now verifies the archive (2c76d4dc…bfa57, 68,441 bytes) before extraction.
Tests cover the rejection path (checksum mismatch) and that the gate compares
rather than always failing.

Not in this PR

Tests

TMPDIR=/home/niteris/t soldr cargo test -p fbuild-library --lib — see the
check-runs; the new tests are test_url_and_checksum_are_pinned,
test_constructor_carries_the_checksum (attiny), the same pair plus
test_verify_archive_rejects_unpinned_bytes /
test_verify_archive_accepts_the_pinned_digest (arduino_api), and
every_registry_entry_is_checksum_pinned (registry).

`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).
@coderabbitai

coderabbitai Bot commented Nov 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

Parsing warnings: 1

Validation error: Unrecognized key: "enabled" at "reviews.pre_merge_checks"
Configuration instructions

  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@zackees
zackees added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit ecccbb0 Nov 21, 2026
33 checks passed
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Nov 22, 2026
@zackees
zackees deleted the agent/attiny-sha-pins branch November 24, 2026 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant