security: harden moontrace security boundaries - #66
Merged
Conversation
brickfrog
marked this pull request as ready for review
August 2, 2026 02:19
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
traceparentandtracestateparsing at 512 characters, avoid eager split/collect work, and reject duplicate wiretracestatekeys0600permissions for newly created native file-subscriber logs and gzip rotations without changing existing file modesWhy
The Codex Security scan surfaced several source-to-sink hardening opportunities in library-owned boundaries: attacker-controlled telemetry reaching human-readable output, unbounded propagation headers and collector responses, deterministic process seeding, permissive default file creation, and mutable CI bootstrap artifacts. This groups each shared root cause into one narrow change with focused regression coverage.
The flamegraph label findings are intentionally deferred: those files are explicit operator-controlled profiling artifacts, and the repository does not expose a lower-trust renderer or ingestion boundary that would justify changing their established format in this patch.
Impact
.mbtiinterface changesparse_span_contextstill preserves a validtraceparentwhile dropping invalidtracestate0600Validation
moon info && moon fmt(clean second format pass; no.mbtidiff)moon check --target nativemoon check --target jsmoon check --target wasm-gcmoon test --target native— 293/293 passedmoon test --target js— 280/280 passedmoon test --target wasm-gc— 265/265 passedmoon test— 293/293 passed, exercising the preferred native targetmoon build --target native --releaseumask 022: new active/raw-rotated/gzip files were0600; a pre-existing0640file remained0640bash -n .github/scripts/setup-moonbit.sh0.10.5+5e7afb0c0ran successfullygit diff --check main...HEADshellcheckandactionlintwere not run because they are not installed in the development environment; the remote workflows exercise the bootstrap and workflow definitions.