Repository navigation
Conversation
Read the config through an inspected regular-file descriptor, reject symlinks explicitly (including link swaps), ignore POSIX mode/ownership on all platforms, and keep unreadable-file errors content-free. Add deterministic regression coverage and document the non-secret permission policy.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
…e-filesystem-policy # Conflicts: # docs/reference/troubleshooting.md # src/config/project.ts
Author
|
Update: branch is now merged with current \upstream/main\ (\ |
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.
Summary
Defines and enforces a portable filesystem policy for
stellarforge.config.jsonand closes the remaining ambiguity around permissive file modes, ownership, symlinks, and unreadable files.The config file is non-secret by design (schema version, network, identity alias), so permissive POSIX modes and unusual ownership are intentionally accepted rather than rejected or warned about. The loader instead guarantees that only an inspected regular file inside the project root is ever read.
Workstream:
WS-CONFIG(dependencies: SW-077, SW-082).Policy decision
stellarforge.config.jsonmust be the exact root-level filename and a regular file.chmod/chown, changes permissions, or attempts privilege escalation.Changes
src/config/project.tsO_NOFOLLOWwhere the platform exposes it, verifies the opened descriptor withfstatSync, and re-checks the path after opening before reading.Tests
Added deterministic coverage in
tests/config-filesystem-boundaries.test.tsfor:EACCES);ELOOPfrom a symlink introduced during open;chmod.Also made the existing symlink test in
tests/configuration.test.tscapability-aware so it skips only when the host cannot create symlinks (for example an unprivileged Windows runner), instead of failing.Documentation and release note
docs/reference/configuration.md— documents the non-secret permission policy, symlink behavior, unreadable-file error, and no-auto-chmod guarantee.docs/reference/troubleshooting.md— adds remediation guidance for unreadable config files and the cancellation exit code.docs/reference/platform-support.md— notes that POSIX permission bits are not used as config trust signals.Testing
All checks below were run against the merged branch (including current
upstream/mainat07bb0a3):npm ci --ignore-scripts— pass.npm run typecheck— pass.npm run lint— pass.npm run format:check— pass.npm run audit:workflow-permissions— pass.npm test— 91 files passed; 2105 tests passed, 5 skipped.npm run build— pass.npm run test:e2e— pass (linked CLI and packed-tarball consumer smoke).basic-app,api-service, andfull-stack:npm install,npm run check, andnpm testall pass.config-filesystem-boundaries,configuration,config-malformed-json, UTF-8/BOM) pass.actionlintwas not run locally because the Go toolchain is unavailable in this environment; the repository's workflow static checks (workflow-security,workflow-permissions,release-workflow) pass.The merge also repaired broken cancellation/exit-code APIs, lint/format drift, and missing workflow-permission fixtures inherited from
upstream/main, so the required CI jobs are green on this branch.Security
chmod,chown, permission mutation, or privilege escalation is performed; POSIX mode and ownership bits are ignored on all platforms.130.Stellar Wavelabel was not applied by this PR; activation remains an explicit maintainer decision. The linked issue already carries the label.Closes #340