Back to skill

Security audit

API 探针

Security checks for vulnerabilities and agentic risk

Overview

This API testing skill is coherent, but it includes live destructive, security, and load-testing examples without strong authorization or safety gates.

Install only if you will use it on APIs you own or are explicitly authorized to test. Before running generated tests, restrict targets to staging or disposable environments, remove destructive payloads by default, set timeouts and rate limits, avoid real credentials, and require separate confirmation for security or load testing.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:561
Finding
Active Destructive and High-Volume API Testing Lacks Mandatory Authorization Safeguards<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:561-581`, `SKILL.md:604-617`, and `SKILL.md:645-651` **Vulnerability Type**: Unsafe active security and load-testing defaults **Risk Level**: High The Skill provides executable examples that send destructive SQL injection strings and high volumes of requests to a user-controlled `base_url`. ### Complete Code Snippets **Concurrent performance test (`SKILL.md:561-581`):** ```python def test_concurrent_requests(self): def make_request(): return requests.get(f"{self.base_url}/api/users").status_code start = time.time() with ThreadPoolExecutor(max_workers=50) as executor: results = list(executor.map(lambda _: make_request(), range(500))) duration = time.time() - start success_count = sum(1 for r in results if r == 200) qps = 500 / duration print(f"Total requests: 500") print(f"Successful requests: {success_count}") print(f"QPS: {qps:.2f}") print(f"Total duration: {duration:.2f}s") assert success_count / 500 > 0.99 assert qps > 100 ``` **SQL injection test (`SKILL.md:604-617`):** ```python def test_sql_injection(self): payloads = [ "' OR '1'='1", "'; DROP TABLE users; --", "1 UNION SELECT * FROM users" ] for payload in payloads: response = requests.get( f"{self.base_url}/api/users", params={"search": payload} ) assert response.status_code in [400, 403, 500] ``` **Rate-limit test (`SKILL.md:645-651`):** ```python def test_rate_limiting(self): responses = [] for _ in range(150): response = requests.get(f"{self.base_url}/api/users") responses.append(response.status_code) assert 429 in responses ``` ### Technical Analysis Security and performance testing legitimately require network access, but the examples do not enforce least-privilege safeguards around that access. In particular: - The SQL test includes a payload con ...[truncated 2743 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Require explicit authorization before execution** - Ask the operator to confirm ownership or written authorization for the exact hostname. - Record the approved hostname, environment, test type, request budget, and testing window. - Default to generating test plans without executing them. 2. **Block production and third-party targets by default** - Require an explicit override for production environments. - Support a strict hostname allowlist. - Resolve and validate destinations before execution, including redirects, to reduce server-side request forgery and target-switching risks. - Reject metadata, loopback, link-local, and private-network destinations unless expressly approved for the test. 3. **Separate safe and destructive testing modes** - Remove `DROP TABLE` and similarly destructive strings from the default payload set. - Use harmless detection payloads by default. - Require a separate, prominent opt-in before sending destructive payloads. - Prefer disposable test databases and isolated staging environments. 4. **Apply conservative traffic limits** - Begin with one worker and a small request count. - Require explicit approval before increasing concurrency or total requests. - Implement pacing, exponential backoff, jitter, and a global requests-per-second ceiling. - Stop automatically when latency, error rates, or resource consumption exceed safe thresholds. 5. **Add execution safety controls** - Set connection and response timeouts on every request. - Enforce a maximum runtime and total request budget. - Provide an immediate cancellation mechanism. - Avoid automatically retrying unsafe or state-changing operations. 6. **Protect credentials and request data** - Replace hardcoded example passwords with environment-variable or secret-manager placeholders. - Display the final destination before sending authorization headers. - Redact tokens, password ...[truncated 376 chars]
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (8)

External Script Fetching

High
Category
Supply Chain
Content
| Swagger/OpenAPI 文档 | JSON/YAML 格式 | 解析接口定义,生成测试用例 |
| 接口文档 | Markdown/HTML | 提取接口信息,构建测试 |
| 接口地址 | URL + 方法 | 直接发起请求测试 |
| cURL 命令 | shell 命令 | 解析并转换为测试脚本 |
| Postman Collection | JSON 导出 | 导入并执行测试 |

### 2. 接口测试框架
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The skill advertises very broad trigger conditions such as generic mentions of API testing, Swagger, Postman, and interface validation, which can cause it to activate in contexts the user did not clearly intend. Because this skill contains capabilities for live request execution, mock services, performance testing, and security testing, overbroad activation increases the chance of unsafe or unauthorized actions being suggested or initiated against real systems.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The description includes high-impact behaviors like performance testing, security scanning, destructive HTTP methods, and direct request execution without an explicit warning to avoid production or unauthorized targets. In context, this makes the skill more dangerous because it is specifically designed to generate or run actions that can modify data, exhaust resources, or probe defenses on live systems.

External Transmission

Medium
Category
Data Exfiltration
Content
def get_token(self):
        """获取认证 Token"""
        response = requests.post(f"{self.base_url}/auth/login", json={
            "username": "testuser",
            "password": "Test1234"
        })
Confidence
90% confidence
Finding
This sample code performs a live authentication request using embedded test credentials and then reuses the returned bearer token for further API access. In an agent skill context, generating or encouraging direct credentialed requests to arbitrary user-supplied base URLs can lead to credential misuse, unauthorized access attempts, and transmission of secrets to attacker-controlled endpoints.

External Transmission

Medium
Category
Data Exfiltration
Content
}
        }
        """
        response = requests.post(self.graphql_url, json={"query": query}, headers=self.headers)
        
        assert response.status_code == 200
        data = response.json()
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
}
        }
        
        response = requests.post(
            self.graphql_url,
            json={"query": mutation, "variables": variables},
            headers=self.headers
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
]
        
        for payload in payloads:
            response = requests.post(
                f"{self.base_url}/api/users",
                json={"username": payload, "email": "test@example.com"}
            )
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Natural-Language Policy Violations

Low
Confidence
89% confidence
Finding
The manifest description and main instructional content are presented entirely in Chinese, with no indication that the user may choose another language. This can violate a language/locale policy when the skill effectively assumes a fixed language rather than offering a user preference.

Static analysis

No suspicious patterns detected.