mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2026-11-06 12:52:04 +00:00
Teach the mutation harness two blind spots it had, and close what they found
The harness only mutated block-form guards (`if (cond) {`), so every guard
written as a one-liner was invisible to it — which turned out to be most of
the load-bearing ones. src/highRisk.ts generated ZERO mutants and printed as
a clean sweep. Three changes to the tool:
- Mutate single-statement guards too (`if (cond) return ...;`). This alone
surfaced 27 previously unreachable mutants, including the entire token
validation chain: revoked, expired, exhausted, scope-not-granted.
- Report a target that generates no mutants as NOT MEASURED. Zero killed and
zero survived prints exactly like a clean sweep, and it is the one result
that must never be read as a pass.
- Add `kind`, `mnemonic` and `seed` to the security hints. A token's `kinds`
list is half of what it may reach, and leaving the word out hid the shape
check that stops a string `kinds` becoming a substring match.
Also adds `--kind` so a new mutation rule can be swept across every target
without re-judging the mutants already settled.
What the new mutants found, all of it previously unasserted:
- A token's `kinds` restriction was never tested. This file's own header
claimed kinds and labels were both covered; only labels were. Removing the
check let a token scoped to one kind read every other kind's secrets.
- `token-issue` would mint a token for a profile the agent is not holding.
The seed being resident is the only proof the caller had authority over
that vault.
- `token-issue`'s array shape checks for `scopes` and `kinds`. A string
`kinds` turns tokenMaySee's exact match into String.includes.
- An empty high-risk factor. Refused in both implementations, tested in
neither; it would wrap the partition key under nothing while
`factorConfigured` still answered true.
- POST /api/v1/fingerprint/select accepting a profile that does not exist —
the caller's string becomes ctx.fingerprint, which later requests join onto
a path. AppDir repeats the check, so the guard's real value is answering
404 instead of an unhandled 500.
- The API's requiresPassword flag is redundant for every route today, so
disabling it changed nothing. Its purpose is the route that does not exist
yet, whose author sets the flag and forgets the call — so the test now
registers exactly that route and confirms the server layer stops it before
the handler runs.
- sinks.ts drops SEEDPASS_-prefixed variables from a child's environment.
Nothing on the allowlist starts with SEEDPASS_, so the backstop cannot fire
against the real list. sinkEnv now takes the allowlist as a defaulted
parameter purely so that future-edit case can be exercised.
All six targets now sweep to zero survivors.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Vtx94nXDmNgXEeThUZP4QN
This commit is contained in:
1 parent
0f59602622
commit
e1ea9c2b48
7 files changed
+333
-3
No files matched your search
@@ -28,9 +28,16 @@ const PASSTHROUGH_ENV = ["PATH", "HOME", "LANG", "LC_ALL", "TERM", "TZ", "TMPDIR
|
||||
* Build the environment for a sink child: the allowlist above, never the
|
||||
* caller's full environment.
|
||||
*/
|
||||
export function sinkEnv(extra: Record<string, string> = {}): Record<string, string> {
|
||||
export function sinkEnv(
|
||||
extra: Record<string, string> = {},
|
||||
// The allowlist is a parameter purely so the SEEDPASS_ backstop below can
|
||||
// be tested. No entry in PASSTHROUGH_ENV starts with SEEDPASS_ today, so
|
||||
// the check cannot fire against the real list -- which is what makes it a
|
||||
// backstop, and also what made removing it invisible to the suite.
|
||||
passthrough: readonly string[] = PASSTHROUGH_ENV,
|
||||
): Record<string, string> {
|
||||
const env: Record<string, string> = {};
|
||||
for (const key of PASSTHROUGH_ENV) {
|
||||
for (const key of passthrough) {
|
||||
// Backstop, not the control: nothing SEEDPASS-prefixed rides along even
|
||||
// if a future edit adds one to the allowlist. `extra` is exempt — the
|
||||
// exec sink's whole job is injecting SEEDPASS_SECRET.
|
||||
|
||||
Reference in new issue
Block a user