Back to skill

Security audit

qa-engineer-assistant

Security checks for vulnerabilities and agentic risk

Overview

This QA helper is mostly purpose-aligned, but its bundled API-test generator can create unsafe Python from untrusted input and encourages putting real test credentials into generated files.

Review this skill before installing if you plan to use the API test generator. Do not run generated tests from endpoint descriptions supplied by untrusted people without reading the generated Python first, and store API base URLs and credentials in environment variables or a secret manager instead of editing them into conftest.py. Pin dependencies before using the guide in CI or shared developer environments.

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

Error
Location
scripts/gen_api_test.py:90
Finding

Arbitrary Python Code Injection Through Unsanitized Generated Source

Content
View full analysis
str: method_upper = method.upper() method_lower = method.lower() auth_fixture = "" auth_call = "" if auth == "bearer": auth_fixture = "auth_headers, " auth_call = ", headers=auth_headers" elif auth == "none": auth_fixture = "" auth_call = "" # 生成请求体示例(仅 POST/PUT/PATCH) body_example = "" body_param = "" if method_upper in ("POST", "PUT", "PATCH"): body_example = ''' # TODO: 替换为真实的请求体参数 payload = { "key": "value", }''' body_param = ", json=payload" return f'''\ """ {name} — 接口自动化测试 生成日期: {date.today()} 接口: {method_upper} {path} 使用方法: pytest {module}.py -v pytest {module}.py -v --html=report.html """ import pytest import requests class Test{name.replace(" ", "").replace("-", "").replace("(", "").replace(")", "")}: ``` The endpoint path is also inserted directly into executable Python syntax: ```python url = f"{{base_url}}{path}"{body_example} ``` The generated content is written to a Python test file without validation or safe serialization: ```python module = to_snake_case(args.name) test_filename = f"test_{module}.py" os.makedirs(args.out, exist_ok=True) test_path = os.path.join(args.out, test_filename) with open(test_path, "w", encoding="utf-8") as f: f.write(generate_test_file(args.name, args.method, args.path, args.auth, module)) ``` ### Technical Analysis The `--name` and `--path` command-line arguments are interpolated directly into generated Python source code. The transformations applied to `name` remove only a small set of characters and do not guarantee a valid, safe Python identif ...[truncated 2039 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/gen_api_test.py:35
Finding

Generated Test Configuration Encourages Plaintext Storage of Real Credentials

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
references/api-test-guide.md:13
Finding

Unpinned Dependency Installation Creates Supply-Chain Exposure

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (12)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill references a script generator and instructs loading auxiliary files, implying file access and potentially code-generation workflows, but it declares no explicit tool or permission boundaries. Without scoped permissions, an agent runtime may over-grant file/network capabilities, increasing the chance of unintended external access or file modifications during testing-related tasks.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The activation criteria are extremely broad, covering essentially any testing-related request and a large keyword set in two languages. Over-broad triggering can cause the skill to activate in contexts it was not intended for, leading to unnecessary loading of instructions, resource access, or code-generation behavior that may override more appropriate, narrower skills.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

This instruction requires inline comments in Chinese for generated API scripts regardless of the user's language preference. Forcing a specific language without opt-in is a natural-language policy violation under the locale/language policy rules.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

This line requires inline Chinese comments in generated UI scripts for beginners without offering a language choice. That imposes a specific language/locale on output without user consent.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
96% confidence
Finding

This example hardcodes real-looking credentials and sends them to an external endpoint, which encourages insecure secret handling and can lead users to copy the pattern into production or commit valid test credentials into repositories. In the context of a QA assistant skill that teaches testing patterns, this is more dangerous because it presents the practice as a standard fixture pattern and normalizes embedding secrets in code.

Content

Scanner excerpt · references/api-test-guide.md (reported line 51)May include surrounding context.

md
@pytest.fixture(scope="session")
def auth_token(base_url):
    """登录获取 token,整个测试会话只执行一次"""
    resp = requests.post(f"{base_url}/auth/login", json={
        "username": "test@example.com",
        "password": "Test@1234"
    })

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code file contains natural-language documentation and CLI help text entirely in Chinese, which imposes a specific language/locale on users. The policy for SQP-3 flags language or locale constraints when the skill does not offer an explicit user choice or opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The generated conftest template, comments, and fixture docstrings are written in Chinese only, and the same pattern continues throughout generated output. Because these are user-facing instructions embedded in generated files, they impose a locale without user opt-in.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% 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 · references/api-test-guide.md (reported line 159)May include surrounding context.

md
@pytest.fixture(scope="session")
def auth_token(base_url):
    """登录并获取 Bearer Token,整个测试会话只登录一次"""
    resp = requests.post(f"{base_url}/auth/login", json={
        "username": "test@example.com",  # TODO: 替换为测试账号
        "password": "Test@1234"          # TODO: 替换为测试密码
    })

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% 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 · scripts/gen_api_test.py (reported line 50)May include surrounding context.

python
@pytest.fixture(scope="session")
def auth_token(base_url):
    """登录并获取 Bearer Token,整个测试会话只登录一次"""
    resp = requests.post(f"{base_url}/auth/login", json={
        "username": "test@example.com",  # TODO: 替换为测试账号
        "password": "Test@1234"          # TODO: 替换为测试密码
    })

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

Requiring every output to end with '下一步建议 (Next Steps)' imposes Chinese text formatting even when the user may prefer another language. This is a locale/language policy issue because no opt-in or alternative is offered.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

This markdown file contains user-facing instructions exclusively in Chinese, including the title, section headings, and examples. Under the policy rule for language/locale, forcing a specific language without user opt-in can be a natural-language policy violation when no alternative or opt-in is provided.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

This markdown file contains natural-language instructions that effectively force a specific language/locale for skill output. Under the policy, language constraints should either be optional for the user or clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.