Back to skill

Security audit

招投标信息查询|千里马·乙方宝

Security checks for vulnerabilities and agentic risk

Overview

ClawScan marks this skill suspicious because it reports risks around credential handling and unclear tool scope, while its partial scan leaves some evidence incomplete.

Consider the verdict a reason to review the skill before installing. In particular, consider whether you are comfortable submitting login codes or API keys through chat, and whether any configured API destination is trusted. The scan was partial: 102 of 103 components were scanned, and one static analysis was limited, so the evidence does not establish that the unreviewed portions are safe.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (68)

Tainted flow: 'req' from os.environ.get (line 2813, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Sending the API key to the default HTTPS service is legitimate authentication, not inherently exfiltration. However, build_client accepts an unrestricted --base-url or QIANLIMA_BASE_URL, and _request attaches the environment-held API key without validating the destination or requiring HTTPS; an attacker who influences that configuration can capture the key through an attacker-controlled endpoint or plaintext connection. add_unredirected_header protects against forwarding the key on redirects, but not against a malicious initial destination.

Content

Scanner excerpt · scripts/qianlima_skill.py (reported line 2817)May include surrounding context.

python
if self.api_key:
            req.add_unredirected_header("qianlimaApiKey", self.api_key)
        try:
            with urllib.request.urlopen(req, timeout=30) as resp:
                payload = json.loads(resp.read().decode("utf-8"))
        except urllib.error.HTTPError as exc:
            # HTTP errors may contain the authoritative business error and limits.

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/live_validate.py (reported line 656)May include surrounding context.

python
return 2

    state_path = Path(args.state) if args.state else Path(tempfile.gettempdir()) / "qianlima_skill_live_validation_state"
    env = os.environ.copy()
    env["QIANLIMA_SKILL_STATE_DIR"] = str(state_path)
    env.pop("QIANLIMA_SKILL_STATE", None)

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/retest_all_search_fields.py (reported line 449)May include surrounding context.

python
"--user-text",
            case["text"],
        ],
        env=os.environ.copy(),
        text=True,
        capture_output=True,
        check=False,

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/retest_detail_followups.py (reported line 138)May include surrounding context.

python
def run_skill(args: list[str], state_path: Path) -> dict[str, Any]:
    env = os.environ.copy()
    env["QIANLIMA_SKILL_STATE_DIR"] = str(state_path)
    env.pop("QIANLIMA_SKILL_STATE", None)
    proc = subprocess.run(

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/retest_multiturn_state.py (reported line 27)May include surrounding context.

python
def run_skill(args: list[str]) -> dict[str, Any]:
    proc = subprocess.run(
        [sys.executable, str(RUNTIME), *args],
        env=os.environ.copy(),
        text=True,
        capture_output=True,
        check=False,

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/retest_procurement_intention.py (reported line 45)May include surrounding context.

python
"--user-text",
            USER_TEXT,
        ],
        env=os.environ.copy(),
        text=True,
        capture_output=True,
        check=False,

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/retest_semantic_fields.py (reported line 165)May include surrounding context.

python
"--user-text",
            case["text"],
        ],
        env=os.environ.copy(),
        text=True,
        capture_output=True,
        check=False,

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · scripts/package_skill.py (reported line 15)May include surrounding context.

python
EXCLUDE_PARTS = {
    ".git",
    ".codex",
    ".env",
    "config.toml",
    "config.json",
    "credentials.json",

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 · scripts/package_skill.py (reported line 18)May include surrounding context.

python
".env",
    "config.toml",
    "config.json",
    "credentials.json",
    "__pycache__",
    ".pytest_cache",
    ".qianlima-skill-state",

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · scripts/package_skill.py (reported line 47)May include surrounding context.

python
def should_include(path: Path) -> bool:
    if path.is_symlink() or path.name.startswith('.env.') or path.name.endswith('.env'):
        return False
    if any(part in EXCLUDE_PARTS for part in path.parts):
        return False

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
70% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/qianlima_account.py (reported line 86)May include surrounding context.

python
binary = bundled
        if not binary:
            raise AccountError('host_unsupported', 'configuration')
        env = {k: v for k, v in os.environ.items() if k in ('PATH', 'HOME', 'USER', 'TMPDIR', 'LANG')}
        env.update(CODEX_HOME=str(home), RUST_LOG='off')
        self.proc = subprocess.Popen([binary, 'app-server', '--stdio'], stdin=subprocess.PIPE,
            stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, env=env, bufsize=0)

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
70% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · tests/test_account_cancellation.py (reported line 86)May include surrounding context.

python
@unittest.skipUnless(hasattr(signal, 'SIGINT') and hasattr(signal, 'pause'), 'POSIX signal test')
class CancellationTests(unittest.TestCase):
    def run_stage(self, stage):
        env = {k: v for k, v in os.environ.items() if k in ('PATH', 'LANG', 'TMPDIR')}
        proc = subprocess.Popen([sys.executable, str(Path(__file__).resolve()), '--cancel-child', stage],
                                stdin=subprocess.DEVNULL, stdout=subprocess.PIPE,
                                stderr=subprocess.PIPE, env=env)

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/qianlima_skill.py (reported line 2341)May include surrounding context.

python
del command
    rule = EXPLICIT_API_ERROR_RULES.get(error.code) or AUTH_ERROR_RULES.get(error.code)
    if rule:
        return rule
    if is_account_access_error(error):
        return GENERIC_ACCOUNT_ACCESS_RULE
    return {

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/qianlima_skill.py (reported line 2398)May include surrounding context.

python
def render_user_error_from_rule(rule: dict[str, Any]) -> str:
    if rule is AUTH_ERROR_RULES["MISSING_API_KEY"]:
        return rule["next_steps"][0]
    lines = [f"{rule['summary']}。"]
    next_steps = [str(step).strip() for step in rule.get("next_steps") or [] if str(step).strip()]
    if next_steps:

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/retest_three_cases.py (reported line 48)May include surrounding context.

python
"--user-text",
            case["text"],
        ],
        env=os.environ.copy(),
        text=True,
        capture_output=True,
        check=False,

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
70% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · tests/test_account_flow.py (reported line 593)May include surrounding context.

python
thread = threading.Thread(target=server.serve_forever, daemon=True)
        thread.start()
        state = self.root / 'query-state'
        env = {k: v for k, v in os.environ.items() if not k.startswith(('QIANLIMA_', 'CODEX_'))}
        env.update(CODEX_HOME=str(self.home), QIANLIMA_SKILL_STATE_DIR=str(state))
        command = ('set +x\nqlm_key="$("$1" -c \'import sys; sys.path.insert(0,sys.argv[1]+"/scripts"); import qianlima_account as a; a.CodexConfig().export_private(3)\' "$2" 3>&1 1>/dev/null)" || exit 1\n'
                   'export QIANLIMA_API_KEY="$qlm_key"\nunset qlm_key\n'

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 · tests/test_account_flow.py (reported line 851)May include surrounding context.

python
(root / 'SKILL.md').write_text('test')
            (root / 'scripts').mkdir()
            (root / 'scripts' / 'qianlima_account.py').write_text('test')
            for name in ['.env', '.env.prod', 'config.toml', 'config.json', 'credentials.json']:
                (root / name).write_text('test-only-secret')
            (root / '.git').mkdir()
            (root / '.git' / 'config').write_text('test git')

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · tests/test_account_flow.py (reported line 851)May include surrounding context.

python
(root / 'SKILL.md').write_text('test')
            (root / 'scripts').mkdir()
            (root / 'scripts' / 'qianlima_account.py').write_text('test')
            for name in ['.env', '.env.prod', 'config.toml', 'config.json', 'credentials.json']:
                (root / name).write_text('test-only-secret')
            (root / '.git').mkdir()
            (root / '.git' / 'config').write_text('test git')

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · tests/test_account_key_output.py (reported line 244)May include surrounding context.

python
self.assertEqual(settings.read_text(), original)
            for key in (result['api_key'], api.secret):  # login result / user-supplied
                save(key)
                fresh_env = dict(os.environ)
                fresh_env.pop('QIANLIMA_API_KEY', None)
                loader = '''import json, os, subprocess, sys
values = json.load(open(sys.argv[1]))

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · tests/test_cli_v3.py (reported line 14)May include surrounding context.

python
class CliV3Tests(unittest.TestCase):
    def setUp(self):
        self.tmp=tempfile.TemporaryDirectory();self.addCleanup(self.tmp.cleanup)
        self.env={**os.environ,'QIANLIMA_API_KEY':'offline-cli-key','QIANLIMA_SKILL_STATE_DIR':self.tmp.name}
        self.query={'keywordGroups':[{'keywords':['空调','新风'],'matchScopes':[2]},{'keywords':['安装','改造'],'matchScopes':[8,10]}],'procurementCategories':[0,1],'procurementMethods':[0,2],'fundsSources':[1,5],'hasAnnex':0,'hasAgency':0,'registrationStatus':0,'beginTime':'2026-09-01 10:00:00','endTime':'2026-09-14 18:30:00','numPerPage':2}

    def call(self,command,*args):

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
70% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · tests/test_host_configuration.py (reported line 49)May include surrounding context.

python
stored = json.loads(settings.read_text())
                self.assertEqual(stored['QIANLIMA_API_KEY'], key)
                self.assertEqual(stored['unrelated'], 'preserved')
                env = {k: v for k, v in os.environ.items() if not k.startswith('QIANLIMA_')}
                env['QIANLIMA_SKILL_STATE_DIR'] = str(Path(directory) / 'state')
                query = {'keywordGroups': [{'keywords': ['测试物业'], 'matchScopes': [2]}],
                         'beginTime': '2026-11-01', 'endTime': '2026-11-09', 'numPerPage': 2}

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
70% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · tests/test_validation_baselines.py (reported line 40)May include surrounding context.

python
class ValidationBaselineTests(unittest.TestCase):
    def follow_up_payload(self, fixtures: Path, state_dir: Path, *args: str) -> dict[str, Any]:
        env = {key: value for key, value in os.environ.items() if not key.startswith("QIANLIMA_")}
        env["QIANLIMA_API_KEY"] = "offline-baseline-key"
        env["QIANLIMA_SKILL_STATE_DIR"] = str(state_dir)
        proc = subprocess.run(

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · tests/test_host_configuration.py (reported line 112)May include surrounding context.

python
self.assertEqual(secret, api.secret)
                    for value in (secret, api.token, data['smsCode']):
                        self.assertNotIn(value, output.getvalue())
                    env = dict(os.environ, QIANLIMA_API_KEY=secret)
                    child = subprocess.run([sys.executable, '-c',
                        'import os; assert os.environ["QIANLIMA_API_KEY"].startswith("qlm_"); print("ready")'],
                        env=env, capture_output=True, text=True, check=True)

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · tests/test_qianlima_skill.py (reported line 447)May include surrounding context.

python
self.assertNotIn(url, visible_text)

    def run_skill(self, *args: str, state_path: Path) -> dict:
        env = os.environ.copy()
        env["QIANLIMA_MOCK_DIR"] = str(FIXTURES)
        env["QIANLIMA_SKILL_STATE_DIR"] = str(self._state_dir_for_test(state_path))
        env.pop("QIANLIMA_SKILL_STATE", None)

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · tests/test_qianlima_skill.py (reported line 469)May include surrounding context.

python
return payload

    def run_skill_with_fixtures(self, fixtures: Path, *args: str, state_path: Path) -> tuple[int, dict]:
        env = os.environ.copy()
        env["QIANLIMA_MOCK_DIR"] = str(fixtures)
        env["QIANLIMA_SKILL_STATE_DIR"] = str(self._state_dir_for_test(state_path))
        env.pop("QIANLIMA_SKILL_STATE", None)