T09 · Insecure Skill Coding Practices
- Location
tools/vault.py:349- Finding
Credential deletion proceeds without an enforced confirmation gate
- Content
View full analysis
Vulnerability Details
File Location:
tools/vault.py, lines 349–357
Vulnerability Type: Unconfirmed destructive operation
Risk Level: MediumVulnerable Code
python def cmd_delete(args): v, kek = _open(args) v.delete_entry(kek, args.label) v._seal_and_save(kek) print(f"✔ 已删除:{args.label}") return 0Technical Analysis
The
deletecommand permanently removes a credential immediately after the vault is opened. It does not require an explicit confirmation flag, interactive acknowledgment, dry run, or backup.Possession of the master password authenticates access to the vault, but it does not independently establish that the caller intended an irreversible deletion. This distinction is important because the Skill permits Agent and automation use, and
tools/vault.pycan be invoked directly without a separate confirmation mechanism.The relevant flow is:
_open(args)authenticates the caller and loads the vault.v.delete_entry(kek, args.label)removes the selected entry from in-memory state.v._seal_and_save(kek)immediately persists the modified vault.- No confirmation is enforced between selecting the entry and committing the deletion.
This is a reachable destructive operation rather than evidence of malicious intent.
Attack Path
- A user provides or exposes the vault password through the supported argument or environment-variable mechanism.
- An Agent, automation workflow, or incorrectly interpreted instruction invokes:
bash python tools/vault.py delete <label> --password <password> - The command authenticates and locates the specified credential.
- The credential is deleted and the modified vault is immediately written to disk.
- The user receives no final opportunity to inspect or reject the destructive change.
Impact Assessment
The operation does not grant additional system privileges or disclose credential plaintext. Its confirmed impact is permanent l ...[truncated 248 chars]
- Remediation
View remediation
Remediation Suggestions
- Require an explicit
--yesor--confirm-deleteflag for non-interactive deletion. - In interactive mode, display the exact vault path and entry label and require the user to type the label before proceeding.
- Refuse destructive execution when neither interactive confirmation nor the explicit non-interactive confirmation flag is present.
- Add a
--dry-runmode that reports the intended deletion without modifying the vault. - Consider moving deleted entries into a recoverable trash area rather than immediately removing them.
- Optionally create a timestamped encrypted backup before committing deletion.
- Add tests proving that deletion fails closed when confirmation is absent.
- Require an explicit
