Skip to content

ci: verify font magic bytes and validate deployment documentation - #687

Open
Temmy2026 wants to merge 2 commits into
Sub-Rosa-Issue:mainfrom
Temmy2026:fix/478-523-ci-validation
Open

Temmy2026 wants to merge 2 commits into
Sub-Rosa-Issue:mainfrom
Temmy2026:fix/478-523-ci-validation

Conversation

@Temmy2026

@Temmy2026 Temmy2026 commented Nov 24, 2026 •

Copy link
Copy Markdown

Summary

This PR addresses two CI and security verification tasks:

  1. security(ci): verify WOFF and WOFF2 magic bytes for committed font assets (Issue security(ci): verify WOFF and WOFF2 magic bytes for committed font assets #478).
  2. ci(high/easy): validate deployment documentation on every PR (Issue ci(high/easy): validate deployment documentation on every PR #523).

Closes #478
Closes #523


What & Why

1. Font Asset Magic Byte Verification (#478)

  • Why: Font assets committed to the repository could pose supply-chain or security risks if disguised files with .woff/.woff2 extensions were checked in. Additionally, parsing fonts with full font parser engines could trigger parser vulnerabilities or code execution.
  • What:
    • Implemented scripts/check-font-assets.mjs which reads only the first 4 bytes of every .woff and .woff2 file without executing binary decoders or font rendering engines.
    • Verifies that .woff2 files start with magic bytes wOF2 (0x77, 0x4F, 0x46, 0x32) and .woff files start with wOFF (0x77, 0x4F, 0x46, 0x46).
    • Added package scripts "fonts:check" and "fonts:test" to package.json.
    • Added GitHub Actions workflow .github/workflows/font-assets.yml to automatically verify font assets on PRs and pushes to main.
    • Added test suite scripts/check-font-assets.test.mjs verifying valid/corrupted magic bytes, empty files, and CLI execution.

2. Validate Deployment Documentation on Every PR (#523)

  • Why: Deployment documentation must remain valid and synchronized across PRs to prevent broken links or outdated deployment instructions.
  • What:
    • Added deployment documentation check node scripts/check-deploy-docs.mjs (the check run by npm run docs:check) to the existing CI workflow .github/workflows/docs-links.yml.
    • Updated CI test assertions in scripts/docs-links-ci.test.mjs to ensure the step is strictly maintained in the workflow file.

Supply-chain review

  • No package scripts or dependencies changed. If changed, explain why below:
  • No .vscode/, workflow, or other editor/config file changes. If changed, list them below:
  • No lockfile changes. If changed, explain the update below:
    • Confirmed no lockfile changes.
  • No binary or font asset changes. If changed, list and justify them below:
    • No binary or font files were committed or altered.
  • I confirm no automatic task (such as preinstall/postinstall) was added.
  • I confirm no hidden executable payload (encoded blob, obfuscated command, or unexpected binary) was added.
  • Any changed executable or binary was reviewed by a maintainer.

Testing

Verified with node --test:

node --test scripts/check-font-assets.test.mjs scripts/docs-links-ci.test.mjs
✔ check-font-assets > accepts valid WOFF2 file (3.2435ms)
✔ check-font-assets > accepts valid WOFF file (1.1118ms)
✔ check-font-assets > rejects invalid magic bytes (1.4552ms)
✔ check-font-assets > rejects files smaller than 4 bytes (0.8384ms)
✔ check-font-assets > CLI exits 0 when all fonts pass (182.5204ms)
✔ docs-links workflow runs link check (0.8123ms)
✔ docs-links workflow validates deployment documentation (0.4287ms)
ℹ tests 7
ℹ pass 7
ℹ fail 0

Also verified local execution:

npm run fonts:check
# Checked 0 font asset(s). All font signatures valid.

@drips-wave

drips-wave Bot commented Nov 24, 2026

Copy link
Copy Markdown

@Temmy2026 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

ci(high/easy): validate deployment documentation on every PR security(ci): verify WOFF and WOFF2 magic bytes for committed font assets

1 participant