Repository navigation
Security and Reproducible Builds
Hakan Batuhan Kaba edited this page Nov 13, 2026
·
1 revision
Supply-chain integrity is a first-class design goal of RubyToFaster.
By default, pkg.reproducible = true is active:
-
Deterministic Timestamps: Honors the standard
SOURCE_DATE_EPOCHenvironment variable (orpkg.source_date_epoch = ...). When unset, defaults to RubyGems' canonical deterministic epoch (315619200/1980-01-02 00:00:00 UTC). -
Sorted Tar Entries: Regardless of filesystem directory traversal order or
spec.filesarray ordering,data.tar.gzentries are sorted lexicographically by path. -
Normalized POSIX Modes: Executable scripts in
spec.bindirreceive0755; all regular files receive0644; outer.gemtar components (metadata.gz,data.tar.gz,checksums.yaml.gz) receive0444. -
Deterministic Gzip Headers:
Zlib::GzipWriter#mtime=is pinned to the resolved epoch.
SOURCE_DATE_EPOCH=1700000000 rtf build --no-cache -o pkg-a
SOURCE_DATE_EPOCH=1700000000 rtf build --no-cache -o pkg-b
sha256sum pkg-a/*.gem pkg-b/*.gem
# Both SHA-256 digests will match identically.-
Tar-Slip & Path Traversal Prevention: Relative paths containing
.., leading/, or NUL bytes raiseRubyToFaster::SecurityError. -
Symlink Containment: Source symlinks pointing outside the repository root—and all symlinks inside frontend build output directories (
dist/,.next/,out/)—are blocked. -
No Shell String Execution: Custom
build_command:arguments must be passed as anArrayof strings (e.g.,["pnpm", "run", "build"]) and are executed viaOpen3.capture3(env, *argv)without/bin/sh. -
Automatic Credential Pruning:
.env*,*.pem,*.key,*.p12,id_rsa,id_ed25519, andcredentials.yml.encare excluded by default and rejected if forced understrict_security = true.
For vulnerability reporting procedures, see SECURITY.md.
RubyToFaster — Minimalist script-first Ruby gem build system by HNM Labs · MIT License · Security Policy