Back to skill

Security audit

'AI自动化测试平台'

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent internal AI testing platform, but it needs Review because the bundled app and deployment guidance expose broad code execution, weak admin authorization, and weak secret/database handling.

Treat this as suitable only for isolated internal development until fixed. Before production or shared deployment, require a real sandboxed runner for test scripts, deny-by-default admin authorization, separate admin roles, strong secret storage, non-root database credentials, closed database ports, dependency upgrades, and safer installation instructions.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (7)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
project/backend/app/services/system_service.py:153
Finding

Stored API Key Exfiltration Through an Attacker-Controlled Model Endpoint

Content
View full analysis
Dict: config = self.get_ai_model_config(config_id) if not config: return {"success": False, "message": "配置不存在"} try: if config.model_type == "online": from langchain_openai import ChatOpenAI llm = ChatOpenAI( openai_api_key=self._decrypt_api_key(config.api_key), openai_api_base=config.api_base_url, model=config.model_name, timeout=config.timeout ) response = llm.invoke("Hello") return {"success": True, "message": "连接成功", "response": str(response)} ``` The authorization middleware does not assign an administrative permission to system-management routes: ```python def _get_required_permission(self, path: str) -> str: if "/generate/" in path or "/case" in path: return "generate" elif "/execute/" in path or "/script/" in path: return "execute" else: return None ``` ### Technical Analysis The model API base URL is user-configurable, while the stored API key is decrypted and supplied to `ChatOpenAI` when the connection test runs. System-management routes require only a generally valid authorization code because `_get_required_permission()` returns `None`. An attacker can therefore change an existing model configuration's `api_base_url` without replacing its stored API key. Invoking the test endpoint causes the server to make an authenticated request to the attacker-controlled destination. The authorization header sent by the OpenAI-compatible client can expose the victim's model-provider credential. The ...[truncated 966 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
project/backend/app/services/api_test_service.py:278
Finding

User-Controlled Test Scripts Execute as Arbitrary Python in the Application Environment

Content
View full analysis
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
project/backend/app/core/dependencies.py:87
Finding

Low-Privilege Authorization Codes Can Create Full-Access Codes and Perform Administrative Operations

Content
View full analysis
str: if "/generate/" in path or "/case" in path: return "generate" elif "/execute/" in path or "/script/" in path: return "execute" else: return None ``` The authorization-code creation endpoint has no endpoint-level administrator check: ```python @router.post("/create_auth", response_model=CreateAuthCodeResponse, summary="创建授权码") def create_auth_code( request: CreateAuthCodeRequest, db: Session = Depends(get_db) ): valid_permissions = ["all", "generate", "execute"] if request.permission not in valid_permissions: raise HTTPException( status_code=400, detail=f"无效的权限类型,必须是 {valid_permissions} 之一" ) auth_service = AuthCodeService(db) result = auth_service.create_auth_code( permission=request.permission, max_days=request.max_days, max_count=request.max_count ) return CreateAuthCodeResponse( encrypted_code=result["encrypted_code"], permission=result["permission"], expire_time=result["expire_time"].strftime("%Y-%m-%d %H:%M:%S"), max_count=result["max_count"] ) ``` ### Technical Analysis Routes that do not match the two string patterns receive `required_permission=None`. This includes `/api/admin/*` and `/api/system/*`. The middleware still checks that a code is valid, but it does not require that the caller possess `all` or a dedicated administrator permission. Consequently, a caller holding a limited `generate` or `execute` code can request creation of a new authorization co ...[truncated 1063 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
project/backend/app/services/system_service.py:428
Finding

Model Provider API Keys Are Stored Using Reversible Base64 Encoding

Content
View full analysis
str: """加密API Key(简单实现)""" # 生产环境应使用更强的加密算法 import base64 return base64.b64encode(api_key.encode()).decode() def _decrypt_api_key(self, encrypted_key: str) -> str: """解密API Key""" import base64 return base64.b64decode(encrypted_key.encode()).decode() ``` ### Technical Analysis Base64 is an encoding scheme, not encryption. It does not use a secret key and provides no confidentiality. Any database reader, backup reader, or attacker who obtains the stored value can recover the API key immediately. The names `_encrypt_api_key` and `_decrypt_api_key` may also mislead maintainers into believing the storage mechanism provides cryptographic protection. ### Attack Path 1. Obtain read access to the `ai_model_configs` table through database exposure, backup access, SQL injection, or application compromise. 2. Read the `api_key` column. 3. Base64-decode the value using standard tooling. 4. Use the recovered provider credential against the external model service. ### Impact Assessment All configured model-provider credentials can be disclosed. Attackers may access provider accounts, consume paid quota, retrieve provider-side resources where permitted, or use the keys in further attacks. ]]>
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
project/docker-compose.yml:9
Finding

MySQL Is Published with a Hardcoded Weak Root Credential

Content
View full analysis
Remediation
View remediation

T03 · Remote Payload Retrieval and Execution

Error
Location
deploy/部署文档.md:203
Finding

Deployment Instructions Execute a Mutable Remote Script as Root

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
deploy/部署文档.md:639
Finding

Deployment Hardening Example Constructs SQL from an Untrusted Authorization Header

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (260)

Known Vulnerable Dependency: pymysql==1.1.0 — 2 advisory(ies): CVE-2024-36039 (PyMySQL SQL Injection vulnerability); CVE-2024-36039 (PyMySQL SQL Injection vulnerability)

Critical
Category
Supply Chain
Confidence
95% confidence
Finding

Using PyMySQL 1.1.0 with a published SQL injection advisory is highly dangerous for a backend service that almost certainly interacts with a database. If unsafe query construction exists anywhere in the codebase, a vulnerable driver can worsen exposure and enable data theft, modification, or privilege escalation.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: langchain-community==0.0.10 — 11 advisory(ies): CVE-2024-2965 (Denial of service in langchain-community); CVE-2024-5998 (LangChain pickle deserialization of untrusted data); CVE-2025-2828 (LangChain Community SSRF vulnerability exists in RequestsToolkit component ) +8 more

Critical
Category
Supply Chain
Confidence
96% confidence
Finding

langchain-community 0.0.10 carries severe advisories including unsafe deserialization and SSRF-related issues. In an AI testing platform that may ingest external documents, URLs, prompts, and tool outputs, these weaknesses could enable code execution, internal network access, or service disruption.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: chromadb==0.4.22 — 4 advisory(ies): CVE-2026-45830 (ChromaDB allows any authenticated users to arbitrarily read, write, update, or d); CVE-2026-45833 (ChromaDB has a code injection vulnerability); CVE-2026-45830 (ChromaDB allows any authenticated users to arbitrarily read, write, update, or d) +1 more

Critical
Category
Supply Chain
Confidence
94% confidence
Finding

ChromaDB 0.4.22 is flagged for authorization and code injection issues, which is serious for any system storing embeddings, prompts, test artifacts, or internal documents. If exploited, an attacker could tamper with stored vectors, exfiltrate sensitive data, or achieve code execution depending on deployment mode.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: python-jose==3.3.0 — 5 advisory(ies): CVE-2024-33663 (python-jose algorithm confusion with OpenSSH ECDSA keys); CVE-2024-33664 (python-jose denial of service via compressed JWE content); CVE-2024-33663 (python-jose through 3.3.0 has algorithm confusion with OpenSSH ECDSA keys and ot) +2 more

Critical
Category
Supply Chain
Confidence
97% confidence
Finding

python-jose 3.3.0 has multiple serious JWT/JWE-related advisories, including algorithm confusion, directly affecting authentication and authorization logic. In a platform explicitly handling authorization management, exploitation could enable token forgery, auth bypass, denial of service, or compromise of trust boundaries.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

This finding again highlights execution of arbitrary stored Python scripts through pytest/subprocess with weakly described authorization. If accurate, that creates a real remote code execution surface and the mismatch makes it worse by obscuring the risk from operators who may grant the skill broader trust than intended.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

This finding again highlights execution of arbitrary stored Python scripts through pytest/subprocess with weakly described authorization. If accurate, that creates a real remote code execution surface and the mismatch makes it worse by obscuring the risk from operators who may grant the skill broader trust than intended.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

This finding again highlights execution of arbitrary stored Python scripts through pytest/subprocess with weakly described authorization. If accurate, that creates a real remote code execution surface and the mismatch makes it worse by obscuring the risk from operators who may grant the skill broader trust than intended.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

This finding again highlights execution of arbitrary stored Python scripts through pytest/subprocess with weakly described authorization. If accurate, that creates a real remote code execution surface and the mismatch makes it worse by obscuring the risk from operators who may grant the skill broader trust than intended.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

This finding again highlights execution of arbitrary stored Python scripts through pytest/subprocess with weakly described authorization. If accurate, that creates a real remote code execution surface and the mismatch makes it worse by obscuring the risk from operators who may grant the skill broader trust than intended.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

This finding again highlights execution of arbitrary stored Python scripts through pytest/subprocess with weakly described authorization. If accurate, that creates a real remote code execution surface and the mismatch makes it worse by obscuring the risk from operators who may grant the skill broader trust than intended.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

This finding again highlights execution of arbitrary stored Python scripts through pytest/subprocess with weakly described authorization. If accurate, that creates a real remote code execution surface and the mismatch makes it worse by obscuring the risk from operators who may grant the skill broader trust than intended.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

This finding again highlights execution of arbitrary stored Python scripts through pytest/subprocess with weakly described authorization. If accurate, that creates a real remote code execution surface and the mismatch makes it worse by obscuring the risk from operators who may grant the skill broader trust than intended.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

This finding again highlights execution of arbitrary stored Python scripts through pytest/subprocess with weakly described authorization. If accurate, that creates a real remote code execution surface and the mismatch makes it worse by obscuring the risk from operators who may grant the skill broader trust than intended.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

This finding again highlights execution of arbitrary stored Python scripts through pytest/subprocess with weakly described authorization. If accurate, that creates a real remote code execution surface and the mismatch makes it worse by obscuring the risk from operators who may grant the skill broader trust than intended.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

This finding again highlights execution of arbitrary stored Python scripts through pytest/subprocess with weakly described authorization. If accurate, that creates a real remote code execution surface and the mismatch makes it worse by obscuring the risk from operators who may grant the skill broader trust than intended.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding again highlights execution of arbitrary stored Python scripts through pytest/subprocess with weakly described authorization. If accurate, that creates a real remote code execution surface and the mismatch makes it worse by obscuring the risk from operators who may grant the skill broader trust than intended.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

This finding again highlights execution of arbitrary stored Python scripts through pytest/subprocess with weakly described authorization. If accurate, that creates a real remote code execution surface and the mismatch makes it worse by obscuring the risk from operators who may grant the skill broader trust than intended.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

This finding again highlights execution of arbitrary stored Python scripts through pytest/subprocess with weakly described authorization. If accurate, that creates a real remote code execution surface and the mismatch makes it worse by obscuring the risk from operators who may grant the skill broader trust than intended.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This finding again highlights execution of arbitrary stored Python scripts through pytest/subprocess with weakly described authorization. If accurate, that creates a real remote code execution surface and the mismatch makes it worse by obscuring the risk from operators who may grant the skill broader trust than intended.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This finding again highlights execution of arbitrary stored Python scripts through pytest/subprocess with weakly described authorization. If accurate, that creates a real remote code execution surface and the mismatch makes it worse by obscuring the risk from operators who may grant the skill broader trust than intended.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

This finding again highlights execution of arbitrary stored Python scripts through pytest/subprocess with weakly described authorization. If accurate, that creates a real remote code execution surface and the mismatch makes it worse by obscuring the risk from operators who may grant the skill broader trust than intended.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 96)May include surrounding context.

md
- Dependencies managed via `requirements.txt`

Chaining Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

Piping network-fetched content straight into a privileged shell is a classic unsafe command-chaining pattern. It collapses download, trust, and execution into one step, so a compromised upstream or MITM can achieve root-level code execution on deployment hosts.

Content

Scanner excerpt · deploy/部署文档.md (reported line 203)May include surrounding context.

Linux (Ubuntu):

bash
# 使用NodeSource仓库
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install -y nodejs

# 验证安装

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · deploy/部署文档.md (reported line 227)May include surrounding context.

md
sudo apt install -y apt-transport-https ca-certificates curl gnupg lsb-release

# 添加Docker官方GPG密钥
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

# 添加Docker仓库
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · deploy/部署文档.md (reported line 230)May include surrounding context.

md
sudo apt install -y apt-transport-https ca-certificates curl gnupg lsb-release

# 添加Docker官方GPG密钥
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

# 添加Docker仓库
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Static analysis

No suspicious patterns detected.