Repository navigation
fix: security hardening from 2026-08-25 review - #1
Merged
Merged
Conversation
Captures the 2026-08-25 review findings as sequenced work packages with file locks, tests, and explicit non-goals so subagents can implement without overlapping. Co-authored-by: TheCoderBTW <NDilanka@users.noreply.github.com>
Pin actions/checkout, pnpm/action-setup, and actions/setup-node to v4.4.0 commit SHAs in CI and release workflows. Release: enforce zero lint warnings, require v* tag ref for manual publish, and run the example-demo probe before publish preflight. Co-authored-by: TheCoderBTW <NDilanka@users.noreply.github.com>
…SSING
- Add isLinearishRegex to reject ReDoS-shaped patterns and patterns >256 chars
- Cap {m,n} quantifier upper bound at 256; reject unbounded {m,} forms
- Add SEP_PATTERN_UNSAFE and SEP_KEYS_MISSING error codes with defaults
- Regenerate manifest/tools JSON schemas with pattern maxLength
Co-authored-by: TheCoderBTW <NDilanka@users.noreply.github.com>
- Narrow code-adjacent exclusion to identifier-like tokens; do not drop
high-entropy [A-Za-z0-9]{32,} values after JSON/JS structural punct
- Compile bounded, structurally specific registry format.pattern entries
as high-confidence detectors; skip UUID-validation and generic shapes
- Infer prefix-synthesis body charset from registry pattern (Clerk sk_test_)
- Tighten data-URI, stack-trace path, and credentialless DB URL exclusions
- Add regression tests for JSON values, Discord pattern-only keys, and metrics
Co-authored-by: TheCoderBTW <NDilanka@users.noreply.github.com>
Close T2 bypasses: source/. file-readers, unwrap env -i/-u, busybox wrappers, and fail-closed when shell nesting exceeds MAX_PAYLOAD_DEPTH. Keep internal-error fail-open as the documented default. Co-authored-by: TheCoderBTW <NDilanka@users.noreply.github.com>
- Add ProviderKeySchema superRefine mirroring ManifestEntry: verify.url
must be https:// and must not contain {{value}}
- Bound all provider format.pattern quantifiers from {n,} to {n,256} so
init-to-manifest copies pass protocol isLinearishRegex checks
- Add safety tests for bounded patterns and http:// rejection at parse time
Co-authored-by: TheCoderBTW <NDilanka@users.noreply.github.com>
Implement H4–H12 for broker, sinks, manifest, and git safety:
- H6: compileSafePattern wraps all broker RegExp compilation with
isLinearishRegex and throws SEP_PATTERN_UNSAFE
- H12: Broker.use fails before spawn on undeclared or missing keys
(SEP_NOT_DECLARED / SEP_KEYS_MISSING); never injects a subset
- H9: add onRevokeConfirm hook; revoke fails closed without approval
- H4: Darwin keychain write passes secret on stdin via buildDarwinWriteArgs
- H11: chmod 0o600 on .env after atomic rename on POSIX
- H10: assertGitSafe requires .gitignore coverage outside git repos;
export inspectDotenvGitSafety for Wave 3 doctor
- H5: scanText on raw manifest file text rejects secret-shaped comments
Add tests for every behaviour change; fix fixtures to use bounded
{20,256} quantifiers.
Co-authored-by: TheCoderBTW <NDilanka@users.noreply.github.com>
Add revokeConfirmationBody in core and createRevokeConfirm twins that reuse the shared ask() mutex and yes/y gate. Wire onRevokeConfirm in mcp-server bin.ts and sdk createBroker; export createRevokeConfirm from the SDK for HTTP. Escape probe headline key names with escapeForDisplay (S6). Update env_revoke tool descriptions and regenerated dialect JSON. Add env-revoke e2e tests, confirm unit tests, and sdk dispatch revoke coverage. Co-authored-by: TheCoderBTW <NDilanka@users.noreply.github.com>
…il-open - revoke: add TTY confirmation mirroring run (--yes, ENVSEAL_ASSUME_YES) - createBroker: pass through onRevokeConfirm to Broker - doctor: use inspectDotenvGitSafety for gitignore.covers and isTracked - doctor: report hookFailClosed from ENVSEAL_HOOK_FAIL_CLOSED - exit-codes: map SEP_PATTERN_UNSAFE and SEP_KEYS_MISSING - tests: revoke --yes/assume-yes, doctor ignore semantics, hook flag Co-authored-by: TheCoderBTW <NDilanka@users.noreply.github.com>
- Add onRevokeConfirm via createRevokeConfirm(surface) on the Broker - Default to ephemeral 128-bit listen tokens when no opts.token, no existing ~/.envseal/api-token, and ENVSEAL_PERSIST_HTTP_TOKEN is unset - Keep persisted getOrCreateToken behaviour when persist is requested or file exists - Extend hermeticPrompter to approve APPROVE_REVOKE for leak suite - Add contract tests for ephemeral and existing-token modes Co-authored-by: TheCoderBTW <NDilanka@users.noreply.github.com>
…aped comments Wave 4 Agent J (H5): scan on-disk manifest text with @envseal/detector before allowing FILE_TOOLS access. High-confidence hits deny with a fixed reason that omits matched secret text. Clean or missing files still allow. Grep skipped — not in PreToolUse hook matcher. Co-authored-by: TheCoderBTW <NDilanka@users.noreply.github.com>
Align threat-model.md with Waves 1–4 behaviour: expanded PreToolUse heuristics (T2), raw JSONC manifest scanning and env.schema.jsonc Read deny (T3), detector recall improvements (T4), gitignore outside git and chmod 0600 (T7), env_use no partial inject and env_revoke confirmation (T5/T11). Add residual risks for the 32-bit fingerprint confirmation oracle and persisted HTTP API token; note macOS keychain stdin transport. README: Cursor/Aider/Continue Tier B sentence, tool contract updates, nine residual risks. Co-authored-by: TheCoderBTW <NDilanka@users.noreply.github.com>
Keep the Claude Code generated provider stub aligned with bounded format.pattern values, and satisfy lint --max-warnings 0. Co-authored-by: TheCoderBTW <NDilanka@users.noreply.github.com>
NDilanka
marked this pull request as ready for review
August 25, 2026 11:27
Adds a host-matrix that checks project-marker detection, plugin MCP/CLI snippets, a live envseal-mcp tools/list handshake (including the Claude Code bundled CJS), SDK dialects, and HTTP OpenAPI. Cursor rules now name all seven tools including env_await. Co-authored-by: TheCoderBTW <NDilanka@users.noreply.github.com>
security(1) ignores stdin and stores an empty password when -w is omitted. HTTP token tests now set USERPROFILE as well as HOME so Windows os.homedir() hits the fixture. Host-matrix live MCP/CLI checks skip when dist is absent so the no-build portability job still runs static host contracts. Co-authored-by: TheCoderBTW <NDilanka@users.noreply.github.com>
Portability CI does not build packages. generateOpenAPI() pulls @envseal/protocol's published entry, which is dist-only, so assert the generator source instead and keep the live spec check for built trees. Co-authored-by: TheCoderBTW <NDilanka@users.noreply.github.com>
This was referenced Aug 25, 2026
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.
Closes the 2026-08-25 whole-repo security review findings, executed in waves per
docs/security-hardening-plan.md.Also adds a host-matrix (
test/host-matrix.test.ts) that checks envseal still works with every documented coding agent: doctor tiers, plugin MCP/CLI snippets, liveenvseal-mcptools/list(stdio + Claude bundled CJS), SDK dialects, and HTTP OpenAPI.Wave 1
source/.of.env, unwrapsenv -i/busybox, fail-closed when shell nesting exceedsMAX_PAYLOAD_DEPTH(internal-error fail-open default unchanged).SEP_PATTERN_UNSAFE,SEP_KEYS_MISSING;format.patternmust be bounded / linearish.--max-warnings 0; tag required for manual publish; example-demo probe before publish.Wave 2
security add-generic-password -w(stdin is ignored and stored an empty password on macos-latest). Linux/Windows keep stdin/pipe. Residual documented indocs/residual-risks.md.loadManifestscans raw JSONC (including comments).Broker.onRevokeConfirmrequired before anysink.remove..gitignorecovering.env; POSIXchmod 0600after replace.env_userefuses undeclared/missing keys; no partial injection.verify.urlmust behttps://; provider patterns bounded{n,256}.Wave 3
ENVSEAL_ASSUME_YESon agent bindings; CLI--yesremains human-only).ENVSEAL_PERSIST_HTTP_TOKEN=1or~/.envseal/api-tokenalready exists.envseal doctorusesinspectDotenvGitSafetyand reports hook fail-open vs fail-closed.escapeForDisplayon key names.Wave 4
Readofenv.schema.jsoncwhen the file contains high-confidence secret-shaped text.Wave 5
CI follow-ups on this branch
dist/is missing sopnpm test:portability(no package build) still runs static host contracts. OpenAPI coverage without a build is a source assertion that the generator walksSEP_TOOL_NAMES.USERPROFILEas well asHOMEso Windowsos.homedir()sees the fixture.Intentionally not changed
Hook fail-open default, CLI
--yes/ENVSEAL_ASSUME_YESfor humans, fingerprint width, MCP stdio auth, Cursor/Aider/Continue runtime hooks.