T09 · Insecure Skill Coding Practices
- Location
SKILL.md:48- Finding
Destructive Reset of All Simulator Data Without Confirmation
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 48
Vulnerability Type: Destructive command with excessive scope and no confirmation safeguard
Risk Level: MediumVulnerable Code
markdown - Simulator stuck — `xcrun simctl shutdown all`, then `xcrun simctl erase all`Technical Analysis
The recommended
xcrun simctl erase allcommand resets every available simulator rather than limiting the operation to the malfunctioning simulator. Erasure can destroy application data, test state, locally stored credentials, configuration, and debugging artifacts across unrelated simulator environments.The instruction does not warn that erasure is destructive, require explicit user confirmation, recommend preserving relevant data, or first identify the affected simulator. Although the command does not grant additional privileges, its unnecessarily broad scope violates least-destructive-operation principles.
Attack Path
- A user asks an Agent using this Skill to resolve one stuck simulator.
- The Skill recommends shutting down and erasing all simulators.
- The Agent executes
xcrun simctl shutdown all. - The Agent executes
xcrun simctl erase allwithout requesting confirmation. - Data and state belonging to every available simulator are erased, including unrelated development and test environments.
Impact Assessment
The command operates with the invoking user's existing permissions and does not provide privilege escalation. Its impact is confined to simulator environments accessible to that user, but it can cause broad local data loss and disrupt unrelated development, testing, and debugging activities. Potentially affected assets include simulator application data, test fixtures, authentication state, configuration, and forensic artifacts.
- Remediation
View remediation
Remediation Suggestions
Replace the broad reset procedure with a targeted and confirmation-gated workflow:
- List simulator devices and identify the affected device and UDID:
bash xcrun simctl list devices - Attempt a targeted shutdown first:
bash xcrun simctl shutdown <DEVICE_UDID> - Clearly warn the user that erasure permanently removes the selected simulator's data.
- Obtain explicit confirmation immediately before performing erasure.
- Erase only the affected simulator:
bash xcrun simctl erase <DEVICE_UDID> - Recommend preserving any necessary test data or debugging artifacts before erasure.
- Reserve
erase allfor exceptional cases where every simulator is known to require a reset, with a separate explicit confirmation of its global scope.
- List simulator devices and identify the affected device and UDID:
