T09 · Insecure Skill Coding Practices
- Location
scripts/config_keys.py:71- Finding
Procurement credentials are stored in plaintext without restrictive file permissions
- Content
View full analysis
dict: CACHE_DIR.mkdir(parents=True, exist_ok=True) existing: dict = {} if KEYS_FILE.is_file(): try: existing = json.loads(KEYS_FILE.read_text(encoding="utf-8")) except (json.JSONDecodeError, OSError): pass field_map = { "appkey": "appkey", "sign-secret": "signSecret", "sign_secret": "signSecret", "aes-secret": "aesSecret", "aes_secret": "aesSecret", } updated = [] for key, val in values.items(): json_key = field_map.get(key, key) if val: existing[json_key] = val updated.append(json_key) KEYS_FILE.write_text( json.dumps(existing, ensure_ascii=False, indent=2), encoding="utf-8", ) ``` The CLI also accepts secrets directly as command-line arguments: ```python p_set.add_argument("--appkey", default="", help="Procurement APPKEY") p_set.add_argument("--sign-secret", default="", help="SHA512 signing secret") p_set.add_argument("--aes-secret", default="", help="16-byte AES secret") ``` ### Technical Analysis The Skill writes the procurement APPKEY, signing secret, and passenger-encryption key to `.cache/keys.json` as unencrypted JSON. It does not explicitly create the directory with a restrictive mode, create the credential file with mode `0600`, verify ownership, or protect against symbolic-link replacement. Passing the secrets through command-line arguments can additionally expose them through shell history, process inspection, command telemetry, or Agent execution logs. The reviewed project tree did not contain the `.gitignore` file that the documentation claims protects `.cache` and `.env` files. Possession of all three values can enable pr ...[truncated 1137 chars]- Remediation
View remediation
