Formal & Empirical Assurance
Security Architecture & Trust Guarantees
Defense-in-depth verification combining #![forbid(unsafe_code)], Miri Tree Borrows, structure-aware fuzzing, and configurable DoS budgets.
Frontmatter parsers frequently sit at the trust boundary of content management systems, documentation portals, and static site pipelines where Markdown files arrive from external contributors or untrusted repositories. Frontmatter Gen enforces five layers of verification to ensure untrusted inputs cannot trigger memory unsafety, resource exhaustion, or HTML injection.
Memory Safety & Miri Tree Borrows Verification
Both src/lib.rs and src/main.rs declare #![forbid(unsafe_code)], and the YAML 1.2 dependency noyalib is likewise 100% safe Rust. Every pull request runs the test suite under Miri with strict provenance and Tree Borrows aliasing checks:
DoS Budget Guardrails & Fuzzing Harnesses
Untrusted YAML, TOML, or JSON headers can attempt denial-of-service via deeply nested structures or thousands of keys. parser::parse_with_options enforces deterministic budgets before returning a Frontmatter value, backed by four structure-aware cargo-fuzz targets:
| Verification Control | Target / API | Security Guarantee |
|---|---|---|
| Nesting Depth Budget | ParseOptions::max_depth | Rejects YAML, TOML, or JSON trees nested deeper than max_depth levels. |
| Key Count Budget | ParseOptions::max_keys | Rejects frontmatter payloads containing more than max_keys total keys across all maps. |
| HTML Entity Escaping | meta::generate_metatags | Escapes &, <, >, ", and ' in all generated <meta> attributes. |
| LibFuzzer Harnesses | fuzz/fuzz_targets/*.rs | Continuous fuzzing across extract_frontmatter, parse_yaml, parse_toml, and parse_json. |
| Supply-Chain Audits | cargo-deny, cargo-vet, cargo-audit | Verifies license policies, RustSec advisories, and third-party crate audits on every CI run. |
Vulnerability Disclosure Policy (RFC 9116)
If you discover a security vulnerability in frontmatter-gen, please report it privately via GitHub Security Advisories or email sebastien.rousseau@gmail.com. See our machine-readable /.well-known/security.txt for RFC 9116 disclosure metadata.