Skip to content

fix(library): pin the six remaining framework archive checksums - #2137

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

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

Conversation

@zackees

@zackees zackees commented Nov 21, 2026

Copy link
Copy Markdown
Member

What

Six fbuild-library modules constructed PackageBase with checksum: None, so
their framework archive was downloaded and unpacked unverified. This pins the
SHA-256 of each and adds a test per module that fails if a constructor loses it.

That is the remaining in-repo code work of #2128 ("audit: hard-coded vendor
download URLs that bypass the fbuild mirror bucket"), the same treatment #2130
gave the AVR registry entries.

module constant archive
library/rp2040_core.rs RP2040_CORE_SHA256 earlephilhower/arduino-pico 4.5.3 rp2040-4.5.3.zip
library/esp8266_framework.rs ESP8266_FRAMEWORK_SHA256 esp8266/Arduino 3.1.2 esp8266-3.1.2.zip
library/apollo3_core.rs APOLLO3_CORE_SHA256 sparkfun/Arduino_Apollo3 v2.2.1 Arduino_Apollo3.tar.gz
library/stm32_core.rs STM32_CORE_SHA256 stm32duino/Arduino_Core_STM32 2.9.0 archive/refs/tags/2.9.0.tar.gz
library/arduino_mbed_core.rs ARDUINO_MBED_CORE_SHA256 arduino/ArduinoCore-mbed 4.5.0 archive/refs/tags/4.5.0.tar.gz
library/silabs_core.rs SILABS_CORE_SHA256 SiliconLabs/arduino 2.2.0 archive/refs/tags/2.2.0.tar.gz

How the digests were taken

Each URL is the one the code itself builds (not a hand-typed variant). All six
were downloaded from that exact URL on 2026-11-21 (curl -sSL, rc=0), hashed,
and then re-opened to confirm the archive still carries the content the
installer expects — a truncated or wrong-asset download would have failed that
check:

archive bytes sha256 verified contents
rp2040-4.5.3.zip 155,283,656 96a19c55…f1f5ea51b rp2040-4.5.3/cores/rp2040/Arduino.h
esp8266-3.1.2.zip 39,269,515 b3f47686…e335b182 esp8266-3.1.2/cores/esp8266/Arduino.h
Arduino_Apollo3.tar.gz 103,194,820 9906c1cf…231fb694 Arduino_Apollo3/cores/arduino/mbed-bridge/Arduino.h
2.9.0.tar.gz 70,849,310 35d8657a…abb442e45 Arduino_Core_STM32-2.9.0/cores/arduino/Arduino.h
4.5.0.tar.gz 56,099,017 c0fc6d51…bc8e1bc ArduinoCore-mbed-4.5.0/cores/arduino/Arduino.h
2.2.0.tar.gz 503,990,813 79a80075…a6333a4279a9 arduino-2.2.0/cores/silabs/Arduino.h, extra/core-api/ empty as expect_empty_submodule requires

The Silabs archive is the 480 MiB one the module header already documents; the
empty extra/core-api/ is exactly the shape expect_empty_submodule asserts.

Tests

Per module, in the existing mod tests, through the two production
constructors (new and the scratch-root with_cache_root):

cargo test -p fbuild-library --lib
test result: ok. 380 passed; 0 failed; 9 ignored; 0 measured; 0 filtered out

(the six new ones: library::{rp2040_core,esp8266_framework,apollo3_core,stm32_core,arduino_mbed_core,silabs_core}::tests::the_core_archive_is_checksum_pinned;
fmt --check rc 0; clippy -p fbuild-library --lib --all-targets -- -D warnings rc 0;
ci/platform_boundary_research.py --check rc 0, ci/enforce_platform_boundary.py --print-totals rows=0; dylint_rows=0)

Mutation check: reverting any one constructor's Some(X_SHA256) to None makes
that module's the_core_archive_is_checksum_pinned fail (run for rp2040,
soldr cargo test -p fbuild-library --lib rp2040 -> FAILED naming the pin).

Not in this PR

library/esp32_framework/mod.rs cannot be pinned: its URL is dead. ESP32_FRAMEWORK_URL
(pioarduino/arduino-esp32 release 3.1.1/framework-arduinoespressif32-3.1.1.tar.gz)
answers HTTP 404 today, so there is no bytes to hash. It is latent, not an
outage: Esp32Framework::new is documented "legacy, for tests" and has no
production caller — the ESP32 framework resolves through the platformio
registry. It needs a decision (delete the const or repoint it at the 4.x
asset), not a checksum.

The same None pattern also survives in ch32v_core.rs, cmsis_atmel.rs,
sam_core.rs, teensy_core.rs, nrf52_core.rs:145, esp32_platform.rs and
esptool.rs — one pass, one unit; listed on #2128 for the next one.

Bucket uploads and MIRRORED_VENDOR_HOSTS entries are unchanged: they still
need maintainer approval (#2128), and pinning here is what makes a bucket copy
safe to serve later.

#2128 stays open (remaining cells: the bucket uploads, the mirror-host
additions, and the modules listed above).

rp2040_core, esp8266_framework, apollo3_core, stm32_core,
arduino_mbed_core and silabs_core all built PackageBase with
`checksum: None`, so their framework archive was downloaded and
unpacked unverified.

Each SHA-256 was computed from the exact URL the module builds, on
2026-11-21, and the archive was re-opened afterwards to confirm it still
carries the content the installer expects (cores/*/Arduino.h; for
SiliconLabs the empty extra/core-api the module declares).

One test per module asserts the pin through both production
constructors, so a constructor that loses the pin fails.

Refs #2128 (stays open: bucket uploads, mirror-host additions and the
other modules still passing None).
@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 b4f93b3 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/framework-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