EcosystemBar injected the bootstrap-icons stylesheet from jsDelivr with no integrity attribute. If jsDelivr was ever compromised or its CDN served modified bytes, the browser would apply the foreign CSS on every StaffML pageview.
Changes
Add integrity=\"sha384-…\" pinning the v1.11.3 bytes. Hash computed from the actual CDN file:
Add crossOrigin=\"anonymous\" — required for SRI to be enforced on cross-origin resources.
Add an onerror handler that logs to console (with the recompute recipe) when the stylesheet is rejected. Without it the only symptom of a stale hash (e.g. after a version bump) would be silently missing icons across the bar.
Comment includes the recompute recipe so future version bumps update the hash deterministically.
Test plan
npx tsc --noEmit → unchanged (the 2 pre-existing errors on dev about katex / js-quantities are local-env-only; those packages are declared in package.json but missing from local node_modules until npm install runs)
All 57 individual vitest cases still pass. The 4 test files that fail to import on dev fail with the same stash-in / stash-out behavior — unrelated to this PR.
Manual: load the site, confirm icons (envelope, github, etc.) still render. If the hash is wrong they'd vanish.
Manual: temporarily corrupt the hash, reload, confirm the new console.error fires with the recompute recipe.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/harvard-edge/cs249r_book/pull/1833
**Author:** [@farhan523](https://github.com/farhan523)
**Created:** 6/3/2026
**Status:** 🔄 Open
**Base:** `dev` ← **Head:** `fix/ecosystembar-cdn-sri`
---
### 📝 Commits (1)
- [`34d4a7f`](https://github.com/harvard-edge/cs249r_book/commit/34d4a7fdb1123face2a20fbdd6595c63c6ac8eb7) fix(staffml): pin bootstrap-icons CSS with SRI + crossorigin
### 📊 Changes
**1 file changed** (+18 additions, -1 deletions)
<details>
<summary>View changed files</summary>
📝 `interviews/staffml/src/components/EcosystemBar.tsx` (+18 -1)
</details>
### 📄 Description
## Summary
`EcosystemBar` injected the bootstrap-icons stylesheet from jsDelivr with no `integrity` attribute. If jsDelivr was ever compromised or its CDN served modified bytes, the browser would apply the foreign CSS on every StaffML pageview.
### Changes
- Add `integrity=\"sha384-…\"` pinning the v1.11.3 bytes. Hash computed from the actual CDN file:
```
curl -sL https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css \
| openssl dgst -sha384 -binary | openssl base64 -A
```
- Add `crossOrigin=\"anonymous\"` — required for SRI to be enforced on cross-origin resources.
- Add an `onerror` handler that logs to console (with the recompute recipe) when the stylesheet is rejected. Without it the only symptom of a stale hash (e.g. after a version bump) would be silently missing icons across the bar.
- Comment includes the recompute recipe so future version bumps update the hash deterministically.
## Test plan
- [x] `npx tsc --noEmit` → unchanged (the 2 pre-existing errors on `dev` about `katex` / `js-quantities` are local-env-only; those packages are declared in `package.json` but missing from local `node_modules` until `npm install` runs)
- [x] All 57 individual vitest cases still pass. The 4 test files that fail to import on `dev` fail with the same stash-in / stash-out behavior — unrelated to this PR.
- [ ] Manual: load the site, confirm icons (envelope, github, etc.) still render. If the hash is wrong they'd vanish.
- [ ] Manual: temporarily corrupt the hash, reload, confirm the new `console.error` fires with the recompute recipe.
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/harvard-edge/cs249r_book/pull/1833
Author: @farhan523
Created: 6/3/2026
Status: 🔄 Open
Base:
dev← Head:fix/ecosystembar-cdn-sri📝 Commits (1)
34d4a7ffix(staffml): pin bootstrap-icons CSS with SRI + crossorigin📊 Changes
1 file changed (+18 additions, -1 deletions)
View changed files
📝
interviews/staffml/src/components/EcosystemBar.tsx(+18 -1)📄 Description
Summary
EcosystemBarinjected the bootstrap-icons stylesheet from jsDelivr with nointegrityattribute. If jsDelivr was ever compromised or its CDN served modified bytes, the browser would apply the foreign CSS on every StaffML pageview.Changes
integrity=\"sha384-…\"pinning the v1.11.3 bytes. Hash computed from the actual CDN file:crossOrigin=\"anonymous\"— required for SRI to be enforced on cross-origin resources.onerrorhandler that logs to console (with the recompute recipe) when the stylesheet is rejected. Without it the only symptom of a stale hash (e.g. after a version bump) would be silently missing icons across the bar.Test plan
npx tsc --noEmit→ unchanged (the 2 pre-existing errors ondevaboutkatex/js-quantitiesare local-env-only; those packages are declared inpackage.jsonbut missing from localnode_modulesuntilnpm installruns)devfail with the same stash-in / stash-out behavior — unrelated to this PR.console.errorfires with the recompute recipe.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.