Back to skill

Security audit

Health Git

Security checks for vulnerabilities and agentic risk

Overview

The skill is purpose-aligned for a local health workflow, but it documents sensitive health and medication-rule operations with authentication off by default and an unaudited runtime.

Install only in a trusted development environment unless the complete server code and dependency manifest are supplied and reviewed. Before using real health data, enable authentication by default, replace example API keys, restrict rule updates to authorized administrators or reviewers, and require explicit user confirmation for health-data submission and medication-related rule changes.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:15
Finding
Authentication Is Disabled by Default for Sensitive Health and Administrative APIs## Vulnerability Details **File Location**: `SKILL.md`, lines 15-22, 32-34, 55-98, and 126 **Vulnerability Type**: Missing authentication and insufficient privilege separation **Risk Level**: High The documentation states that authentication is disabled by default while describing endpoints that create health records, submit and approve intervention plans, initialize data, expose audit information, and modify medication-review rules. Relevant configuration: ```bash export HEALTH_GIT_BASE_URL=http://localhost:8090 export AUTH_ENABLED=true export CONSUMER_API_KEY=consumer-key export REVIEWER_API_KEY=reviewer-key ``` Unauthenticated data initialization: ```bash curl -X POST http://localhost:8090/api/seed ``` A privileged rule update is also demonstrated without an API key: ```bash curl -s -X PATCH http://localhost:8090/api/rules/MEDICATION_CHANGE_REVIEW \ -H "Content-Type: application/json" \ -d '{"config_json":{"keywords":["increase medication","new drug","double dose","insulin","adjust dose"]}}' ``` ### Technical Analysis Authentication must be enabled by default for an application that processes health activity, medication-related information, intervention plans, review decisions, outcomes, and audit events. Binding the service to localhost reduces network exposure but is not an authorization boundary. Other processes running in the same environment can connect to the service, and the API could also become reachable through container port publishing, reverse proxies, development tunnels, or an altered server binding. The rule-management endpoint is particularly sensitive. Changing `MEDICATION_CHANGE_REVIEW` can alter which medication-related plans are blocked for human review. The example does not provide an administrator or reviewer credential, indicating that the documented default configuration does not enforce least privilege for this operation. The documented reviewer key is also a predictable ...[truncated 1745 chars]
Remediation
## Remediation Suggestions - Enable authentication by default and require an explicit development-only option to disable it. - Require authorization on every endpoint, including read-only dashboard, metrics, events, and rules endpoints. - Implement role-based access control with separate consumer, reviewer, and administrator roles. - Restrict rule creation and modification to a narrowly scoped administrator role. - Require reviewer authorization for review and merge operations, and verify that reviewers cannot approve their own requests where separation of duties is required. - Replace example keys with instructions for generating high-entropy secrets. Reject documented defaults such as `consumer-key` and `reviewer-key`. - Store secrets outside source files and command history, rotate them periodically, and support revocation. - Bind explicitly to the loopback interface for development. Document that port forwarding, public binding, and reverse proxies require TLS and production authentication. - Add request-origin and CSRF protections if browser-based clients can access the API. - Validate and constrain rule updates using a schema, immutable rule identifiers, safe minimum conditions, and administrator approval. - Write tamper-resistant audit records for authentication failures, review decisions, and safety-rule changes. - Add automated tests proving that unauthenticated requests receive `401` responses and unauthorized roles receive `403` responses.

T08 · Insecure Dependencies

Warning
Location
SKILL.md:25
Finding
Referenced Runtime and Dependencies Are Missing and Cannot Be Audited## Vulnerability Details **File Location**: `SKILL.md`, lines 25-29 **Vulnerability Type**: Unverifiable dependency installation and runtime provenance **Risk Level**: Medium The installation instructions direct users to install dependencies and launch an application that are not included in the audited project: ```bash pip install -r requirements.txt uvicorn app.main:app --reload --port 8090 ``` The audited directory contains only `SKILL.md`. It does not contain `requirements.txt`, `app/main.py`, or any other implementation files. ### Technical Analysis Because the referenced dependency manifest and application implementation are absent, the audit cannot verify: - Package names, versions, hashes, or package indexes. - Whether dependencies are pinned against unexpected upgrades. - Whether similarly named or malicious packages could be introduced. - Whether the advertised authentication and authorization controls exist. - What code is executed when `app.main:app` is loaded. - Whether sensitive health information is stored or transmitted securely. The installation command is not inherently malicious. The risk arises because users must obtain the missing files elsewhere or run the commands from another directory. This breaks provenance between the reviewed Skill and the software that is ultimately installed and executed. The `--reload` option is suitable for controlled development environments but should not be used for production operation. It watches files and restarts the process when changes occur, increasing the consequences of an attacker gaining write access to the application directory. ### Attack Path 1. A user follows the instructions but discovers that the documented manifest and application are absent. 2. The user obtains files from an unverified source or runs the commands from an incorrect directory containing attacker-controlled content. 3. `pip install -r requirements.txt` installs the packages ...[truncated 1011 chars]
Remediation
## Remediation Suggestions - Include the complete application implementation and dependency manifest in the reviewed artifact. - Pin all direct and transitive dependencies to reviewed versions. - Use a hash-locked requirements file, such as one generated with `pip-compile` and installed with `pip --require-hashes`. - Document the trusted repository URL, release tag, and cryptographic checksum for distributed artifacts. - Require installation in a dedicated virtual environment under a non-privileged account. - Configure an explicit trusted package index and review packages for dependency-confusion and typosquatting risks. - Add software-composition analysis and vulnerability scanning to the release process. - Verify the expected working directory and required files before running installation or startup commands. - Do not use `--reload` in production. Provide a separate hardened production startup command. - Repeat the security audit after the missing implementation and dependency files are supplied.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (6)

External Script Fetching

High
Category
Supply Chain
Content
**助手操作**:
```bash
curl -s -X POST http://localhost:8090/api/commits \
  -H "Content-Type: application/json" \
  -d '{"branch_id":1,"user_id":1,"task_type":"exercise","evidence_text":"步行8000步","metric_value":8000,"adherence_score":80}'
```
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
curl -s http://localhost:8090/api/rules | python3 -m json.tool

# 更新关键词
curl -s -X PATCH http://localhost:8090/api/rules/MEDICATION_CHANGE_REVIEW \
  -H "Content-Type: application/json" \
  -d '{"config_json":{"keywords":["increase medication","new drug","double dose","insulin","adjust dose"]}}'
```
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The skill includes examples that submit health-related data and modify clinical-review rules without warning the user about privacy, consent, authorization, or the safety implications of changing decision gates. In a healthcare context, silent transmission of sensitive data and unguarded rule changes can lead to privacy violations or unsafe intervention workflows.

External Transmission

Medium
Category
Data Exfiltration
Content
**助手操作**:
```bash
curl -s -X POST http://localhost:8090/api/commits \
  -H "Content-Type: application/json" \
  -d '{"branch_id":1,"user_id":1,"task_type":"exercise","evidence_text":"步行8000步","metric_value":8000,"adherence_score":80}'
```
Confidence
95% confidence
Finding
This example sends health-related user data to a local HTTP service via POST without any user-consent flow, transport security, or discussion of data sensitivity. Even on localhost, an agent following this pattern could disclose sensitive medical information to an untrusted or misconfigured service, especially if the base URL is overridden by environment variable.

External Transmission

Medium
Category
Data Exfiltration
Content
curl -s http://localhost:8090/api/rules | python3 -m json.tool

# 更新关键词
curl -s -X PATCH http://localhost:8090/api/rules/MEDICATION_CHANGE_REVIEW \
  -H "Content-Type: application/json" \
  -d '{"config_json":{"keywords":["increase medication","new drug","double dose","insulin","adjust dose"]}}'
```
Confidence
96% confidence
Finding
This example modifies safety/review rule configuration over an external API without emphasizing authorization, change control, or the downstream clinical impact. Altering medication-review keywords can weaken safeguards or create unsafe approvals, which is especially dangerous in a health-management workflow.

Natural-Language Policy Violations

Low
Confidence
94% confidence
Finding
Natural-language policy violations include forcing a specific language without user opt-in. This file presents all user-facing instructions and examples in Chinese and does not mention that the skill is region-specific or provide an alternative language option.

Static analysis

No suspicious patterns detected.