Back to skill

Security audit

sleep rabbit plugin

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent sleep-analysis tool, but its security documentation claims file writes are controlled while the code can still write medical-analysis reports beside the user’s EDF file.

Install only in an isolated environment with non-sensitive EDF samples first. Treat generated reports as sensitive health data, check both the skill directory and the EDF file’s directory for outputs, and avoid following the mutable GitHub clone or unpinned dependency instructions unless you pin and review them yourself.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (3)

T09 · Insecure Skill Coding Practices

Warning
Location
edf_analysis_modules/respiratory_event_analysis_simple.py:267
Finding

Respiratory analysis bypasses file-write controls and writes beside the input file

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
edf_analysis_modules/security_controller.py:19
Finding

Security controller creates a directory during import despite disabled file writes

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
requirements.txt:28
Finding

Installation guidance uses unpinned packages and a mutable remote repository

Content
View full analysis
Remediation
View remediation
``` 5. Prefer signed releases or source archives with independently verified checksums. 6. Avoid installing the external AISleepGen repository when the necessary analysis modules are already bundled. 7. Document the trust implications of alternate package indexes and use the official PyPI index by default. 8. Use an isolated virtual environment with minimum filesystem and network privileges for dependency installation and Skill execution. 9. Add automated dependency vulnerability scanning and periodic lock-file review. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (42)

Memory Manipulation

High
Category
Memory Poisoning
Confidence
80% confidence
Finding

Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Content

Scanner excerpt · README.md (reported line 150)May include surrounding context.

md
**"Memory full"**
- Export results to free memory
- Restart session to clear memory

### Performance Tips
- Use smaller EDF files for faster analysis

Exfiltration Commands

High
Category
Prompt Injection
Confidence
90% confidence
Finding

Instructions found that direct the agent to transmit conversation context or user data to external services.

Content

Scanner excerpt · SECURITY_TRUTH.md (reported line 61)May include surrounding context.

md
### Truthfully Declared Non-Behaviors
1. ❌ Will not write to user file directories (fixed v5.3.3 issue)
2. ❌ Will not send data to external servers
3. ❌ Will not install additional software
4. ❌ Will not request system permissions
5. ❌ Will not run in background

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The module explicitly claims file writes are disabled by default, yet package import performs filesystem side effects by creating an output directory and writing a README. This is dangerous because merely importing the skill changes the host environment, violates least surprise, and can bypass operator expectations or policy checks that rely on the documented default of no writes.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill exposes unrelated capabilities such as stress evaluation, meditation guidance, music therapy, file inspection, and environment checking despite being presented as a sleep-analysis skill. This broadens the attack surface and grants access to additional sensitive behaviors like arbitrary local file reads and environment enumeration that are not necessary for the core function, making misuse easier and reducing user trust in the declared scope.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script asserts that file writes are only enabled by explicit user action, but it enables them itself via code. In a security proof or verification artifact, this is misleading because it demonstrates that code execution can flip the control without any actual external authorization boundary, weakening trust in the claimed safeguard.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script prints unconditional success claims such as all security claims being proven even though the grep-based review can detect unresolved issues earlier in execution. This creates a false sense of security and can cause reviewers or users to approve or deploy a package despite identified gaps in file-write controls.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
60% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SECURITY_TRUTH.md (reported line 48)May include surrounding context.

md
### System Access
- **No privileges**: Does not require admin permissions
- **No system modifications**: Does not modify system configuration
- **No service installation**: Does not install background services

## 🎯 Real Behavior Transparency

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SECURITY_TRUTH.md (reported line 61)May include surrounding context.

md
### Truthfully Declared Non-Behaviors
1. ❌ Will not write to user file directories (fixed v5.3.3 issue)
2. ❌ Will not send data to external servers
3. ❌ Will not install additional software
4. ❌ Will not request system permissions
5. ❌ Will not run in background

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The package initializer performs directory creation and file writing automatically during import, without requiring user consent or an explicit runtime action. In multi-skill or restricted environments, import-time writes can create unauthorized persistence artifacts, fail unexpectedly under sandboxing, or undermine trust boundaries even if the written content itself is not malicious.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The module-level security claims are contradicted by the implementation: the code constructs multiple output artifact paths directly and contains no visible security controller, permission check, or user-gated write enablement. Misleading security assertions are dangerous because downstream users or orchestrators may trust the module to avoid writing files when, in fact, it is designed around artifact generation paths.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This code emits user-facing status messages in a fixed non-English locale and continues that pattern throughout the script. There is no indication that the user can choose language or that the locale restriction is documented as a justified regional requirement.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The function loads an EDF sleep-study file, which can contain sensitive medical data, but the code provides only generic progress prints and no explicit disclosure about processing potentially sensitive health information. For code-file warning checks, sensitive data handling should have some user-facing notice, comment, or documented warning if privacy impact is relevant.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The module creates paths for analysis outputs under an analysis_outputs directory and later reports those artifact locations, but there is no concrete user disclosure near the operation that files will be generated in that location. Although the header mentions file writes generally, the code itself does not clearly warn the user what artifacts are produced or where.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The docstrings and status messages present this module as a professional respiratory analysis workflow that produces analysis artifacts, and the code computes output file paths for PNG/JSON/TXT results. However, it never calls functions such as plt.savefig() or writes the JSON/text report, while still printing a success message and advertising an output directory, which contradicts the apparent documented intent of producing saved analysis outputs.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This code prepares filesystem output paths for generated analysis artifacts and reports under an analysis_outputs directory, but there is no confirmation prompt and no clear docstring or comment warning the user that running the function will create files. For a code file, file-writing behavior should have some visible disclosure unless it is clearly communicated as part of the skill's behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This codebase presents its title, console output, generated reports, and clinical recommendations entirely in Chinese, indicating a fixed language/locale behavior. The policy for this category applies to language constraints that are imposed without user opt-in, and there is no mechanism here to select another language or acknowledge the restriction.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
80% confidence
Finding

The module docstring and class comments emphasize a security controller focused on controlling file writes, yet object initialization immediately creates an analysis_outputs directory as a side effect. This contradicts the stated framing that file writes are disabled by default and that writes are only enabled by explicit user action.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The visualization methods accept an output_path parameter and the main routine constructs a timestamped PNG path, which strongly signals an intent to write result images. However, both plotting methods only build figures and call plt.close() without any save operation, and main never creates the output directory either, so the documented/implied output behavior does not occur.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

This code loads an EDF file containing potentially sensitive physiological data and then generates output artifacts, including a plot path under a user-specified output directory. While there is some status printing, there is no clear user-facing warning, comment, or docstring disclosing that medical sleep data will be read and output files will be created, which matters for privacy and data-handling awareness.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The module docstring claims this is a 'Sleep Spindle Analysis Module', which implies a focused spindle-detection purpose. However, the implementation includes full EDF loading, sleep staging, respiratory event detection, SpO2 validation, summary generation, and reporting beyond spindle analysis.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The second docstring frames the module as 'respiration sleep analysis based on AASM standard'. Later code includes a dedicated SpindleDetector, spindle statistics, and spindle visualizations, which materially expand the module beyond what that inline documentation states.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module configures file-based logging and later writes analysis artifacts to disk, which can include paths, timestamps, and potentially sensitive sleep-study derived results. In a healthcare or research context, silently persisting such data increases the risk of local data exposure, accidental retention, and unauthorized access on shared systems.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The module ingests EDF sleep-study files, which commonly contain sensitive health information, yet provides no privacy notice, retention guidance, or safeguards around downstream persistence and handling. In the context of an agent skill, this is more concerning because users may run it in automated environments without realizing medical data is being processed and later stored.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The report note says the analysis is based on sleep EEG/EOG/EMG, which conveys multimodal physiological analysis. In practice, the code selects only the first EEG channel at L109-L110 and all extracted features/classification are derived from that signal; detected EOG/EMG channels are listed but never used.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring presents this as a real professional analysis module, and the code flow in steps [8/8] and helper names suggests it produces saved analysis outputs. However, the JSON path is computed but never written, and the plotting/text-report helpers only construct paths and print messages without saving files, contradicting the documented/output intent.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.