Files
felhom.eu/documentation/audits/SPIKE-cc-creds-2026-10-17/probes/q1b.sh
T
adminandClaude Opus 5.5 b9c4f73bfa
gates / gates (push) Failing after 6m36s
SPIKE cc-creds: secret broker + CC transcript guards measured with canaries (R-1118..R-1122, 168 -> 173)
Mask PASS, PreToolUse refuse PASS, PostToolUse replace PARTIAL (crash and
large-output disk leaks, both with a measured fix), SOPS+age store PARTIAL
(private repo could not be created), transcript sweep PASS. Fake secrets
only; ~/.config/credentials not read; no CC settings changed. Files use
"creds": .gitignore *secret* ignores the brief's names. STATUS D10: the
store choice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012qRErfCoiTkvDK9N5XHbzb
2026-10-17 11:57:24 +02:00

29 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
# Q1 extra: non-hex canary so URL / JSON forms differ from raw; base64 at offsets 1 and 2.
# Red-proof check is independent of mask.py: decode the output with stdlib and count the raw value.
cd "$(dirname "$0")"; C=canary-Q1S.txt; OUT=evidence/q1/raw
cnt() { python3 - "$C" "$1" "$2" <<'P'
import base64, json, sys, urllib.parse
v = open(sys.argv[1]).read(); d = open(sys.argv[2], "rb").read().decode("utf-8", "replace").strip(); how = sys.argv[3]
if how == "url": d = urllib.parse.unquote_plus(d)
elif how == "json": d = json.loads(d)
elif how == "b64":
try: d = base64.b64decode(d).decode("utf-8", "replace")
except Exception: d = ""
print(d.count(v))
P
}
declare -A S H
S[8-urlencode]="python3 -c 'import os,urllib.parse;print(urllib.parse.quote(os.environ[\"C\"],safe=\"\"))'"; H[8-urlencode]=url
S[9-quote_plus]="python3 -c 'import os,urllib.parse;print(urllib.parse.quote_plus(os.environ[\"C\"]))'"; H[9-quote_plus]=url
S[10-json]="python3 -c 'import os,json;print(json.dumps(os.environ[\"C\"]))'"; H[10-json]=json
S[11-b64-offset1]='printf "x%s" "$C" | base64 -w0'; H[11-b64-offset1]=b64
S[12-b64-offset2]='printf "xy%s" "$C" | base64 -w0'; H[12-b64-offset2]=b64
S[13-b64-wrapped76]='printf "%s%s%s" "$C" "$C" "$C" | base64'; H[13-b64-wrapped76]=b64
printf '%-18s %8s %8s\n' shape unfilt filt
for k in $(printf '%s\n' "${!S[@]}" | sort -n); do
python3 mask.py --secret C=$C --no-filter -- bash -c "${S[$k]}" >$OUT/$k.unf 2>&1
python3 mask.py --secret C=$C -- bash -c "${S[$k]}" >$OUT/$k.filt 2>&1
printf '%-18s %8s %8s\n' $k "$(cnt $OUT/$k.unf ${H[$k]})" "$(cnt $OUT/$k.filt ${H[$k]})"
done