Back to skill

Security audit

Mbti Guru

Security checks for vulnerabilities and agentic risk

Overview

This MBTI skill is mostly purpose-aligned, but its local session storage has real cross-user access and retention flaws for personality-test data.

Review before installing on a shared or public bot. The skill saves personality-test progress and results locally, and this version should not be used for multiple untrusted users until session ownership checks and cleanup/retention behavior are fixed. It does not show evidence of intentional exfiltration or destructive system behavior.

Vulnerability Patterns
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (2)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
lib/session.py:85
Finding

Prefix-Based Session Ownership Check Enables Cross-User Session Access

Content
View full analysis
Optional[Dict]: """ 获取用户未完成的会话 Args: chat_id: 用户ID Returns: 最新的未完成会话或None """ ensure_data_dir() sessions = [] for filename in os.listdir(DATA_DIR): if filename.endswith('.json') and filename.startswith(str(chat_id)): filepath = os.path.join(DATA_DIR, filename) with open(filepath, 'r', encoding='utf-8') as f: session = json.load(f) sessions.append(session) if not sessions: return None # 返回最新的未完成会话 sessions.sort(key=lambda x: x['timestamp'], reverse=True) latest = sessions[0] # 检查是否真的未完成 if latest['current_index'] < latest['questions_total']: return latest return None ``` The same unsafe matching rule is present in the session-listing function: ```python def list_user_sessions(chat_id: int, include_complete: bool = False) -> List[Dict]: """ 列出用户的所有会话 Args: chat_id: 用户ID include_complete: 是否包含已完成的 Returns: 会话列表 """ ensure_data_dir() sessions = [] for filename in os.listdir(DATA_DIR): if filename.endswith('.json') and filename.startswith(str(chat_id)): filepath = os.path.join(DATA_DIR, filename) with open(filepath, 'r', encoding='utf-8') as f: session = json.load(f) if include_complete or session['current_index'] < session['questions_total']: sessions.append(session) sessions.sort(key=lambda x: x['timestamp'], reverse=True) return sessions ``` ### Technical Analysis Session files are named using the pattern `_< ...[truncated 1781 chars]
Remediation
View remediation
/.json ``` 4. Normalize channel identifiers to a strict type before using them. If identifiers may be strings, permit only an explicit safe character set or derive storage keys using a cryptographic hash. 5. Centralize authorization in a helper that resolves a session only after verifying both the canonical path and the record owner. 6. Add regression tests covering overlapping identifiers such as `12`, `123`, and `1200`, and verify that each user can only enumerate and resume their own sessions. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
lib/session.py:36
Finding

Timestamp-Based Session Snapshots Remain After Completion or Cancellation

Content
View full analysis
str: """ 保存测试进度 Args: chat_id: 用户ID version: 测试版本(70/93/144/200) current_index: 当前题目索引(从1开始) answers: 已完成的答案 [(question_id, choice), ...] questions_total: 总题数 Returns: session_id: 会话ID,用于恢复 """ ensure_data_dir() timestamp = int(time.time()) session_id = f"{chat_id}_{timestamp}" session_data = { "session_id": session_id, "chat_id": chat_id, "version": version, "current_index": current_index, "answers": answers, "questions_total": questions_total, "timestamp": timestamp, "created_at": datetime.now().strftime("%Y-%m-%d %H:%M:%S") } filepath = os.path.join(DATA_DIR, f"{session_id}.json") with open(filepath, 'w', encoding='utf-8') as f: json.dump(session_data, f, ensure_ascii=False, indent=2) return session_id ``` On completion, only the most recently referenced session is deleted: ```python # 每次都保存进度 save_progress(chat_id, state) # 检查是否完成 if state.current_index >= len(state.questions): type_code, scores = calculate_type(state.answers) clarity = {dim: calculate_clarity(score) for dim, score in scores.items()} # 保存结果到历史 save_test_result(chat_id, type_code, scores, clarity, state.version, len(state.answers)) # 清理 if state.session_id: delete_session(state.session_id) clear_user_state(chat_id) ``` ...[truncated 2425 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (33)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The description and most feature/command text are written in Chinese, while the file advertises support across many channels. This can amount to a language/locale policy issue because the skill does not clearly offer users an opt-in or choice of interface language, even though it mentions bilingual PDF reports only for output artifacts.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The skill explicitly stores personality-test sessions and history in local JSON files but provides only minimal privacy language and no clear retention limits, sensitivity warning, or access-control details. Personality-profile data can be sensitive, so unclear retention and protection practices increase the risk of privacy leakage, overcollection, and unauthorized local exposure.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The personality type names, example questions, and full interaction flow are presented in Chinese, and the start trigger/result prompts show the assistant operating in Chinese by default. There is no indication that users can choose another language or opt in to this locale, which can violate language/locale policy requirements.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The design explicitly includes persisted test results under data/results/ but provides no accompanying notice, consent flow, retention policy, or description of how sensitive personality data will be handled. Personality assessments can reveal intimate behavioral traits, so silent storage increases privacy risk through over-collection, unauthorized retention, or later disclosure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The document specifies storing per-user session progress and MBTI test history keyed by chat_id, but it does not mention any notice, consent, retention limits, or deletion controls for this personal behavioral data. Even if the data is not highly sensitive by itself, persistent storage of user-linked assessment results can create privacy, compliance, and misuse risks if users are unaware their responses and results are retained.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The document plans persistent storage of user session and history data tied to identifiers such as user_id/chat_id, but does not mention consent, retention limits, access controls, or deletion behavior. In a user-facing personality-testing skill, this creates a real privacy risk because behavioral answers and result history can be stored longer than users expect and may be exposed or misused if the host environment is shared or compromised.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The planned Telegram push for real-time feedback implies outbound transmission of user progress and inferred personality tendencies, yet the document provides no user warning or consent flow. Even if Telegram is the primary interface, proactive pushes and partial-analysis messages can disclose sensitive profiling data through notifications, third-party infrastructure, or unintended recipients on shared devices.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The specification hard-codes bilingual Chinese and English output as a requirement, which removes user control over language preference and can cause unnecessary disclosure of content in an additional locale. While not a classic security flaw, it is a real policy and privacy concern because output may be forced into an unintended language context without consent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Requiring Chinese translation for every English point enforces a fixed locale policy regardless of user need, which can create privacy, usability, and compliance issues in contexts where only one language was requested. The danger is contextual rather than exploit-driven: the skill may expose or duplicate sensitive content in an unrequested language form.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This Python file contains natural-language strings entirely in Chinese, including the module docstring and user-facing status messages. The policy requires flagging language or locale constraints when a skill forces a specific language without offering user choice or documenting a justified locale restriction.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The code persists per-user MBTI test history, including personality type, scores, and timestamps, to local disk without any visible consent, retention notice, or privacy control in this module. Personality assessment data is sensitive profile information, so silent storage increases privacy risk if users are unaware, if the host is shared, or if files are later accessed, copied, or breached.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The delete_history function can remove all saved history by deleting the tests.json file, or overwrite it to remove individual entries. This is a destructive operation, but the code contains no confirmation prompt, user-visible warning, or explicit disclosure about the irreversible deletion behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

All user-visible messages in this file are presented in Chinese, and the module description states support for multiple platforms rather than a China-only or Chinese-only deployment. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The code persists users' MBTI answers, progress, and test history, which can reveal sensitive personality-profile data, but this file shows no notice, consent flow, retention policy, or user-facing disclosure before storage occurs. In a chatbot context spanning multiple platforms, silent persistence increases privacy risk because users may not expect profiling data and longitudinal history to be stored server-side.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The module docstring and all user-facing question text are written exclusively in Chinese, and the file provides no indication that language selection is optional or configurable. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This Python file stores all user-facing questionnaire text in Chinese, and there is no indication in code comments or interfaces that the skill is Chinese-only or that users can select another language. That creates a natural-language locale policy concern because the skill implicitly enforces a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The module docstring and all user-facing text data are written in Chinese, and the file provides no indication that language selection is optional or that the skill is intentionally region-specific. This creates a natural-language policy concern because the skill appears to enforce a specific locale without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module description explicitly states it generates bilingual reports, and the report templates throughout the file are fixed to English and Chinese labels. This enforces a specific language/locale presentation without user opt-in or any visible mechanism to choose another language, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
75% confidence
Finding

The module’s descriptive text and inline documentation are entirely in Chinese, with no indication that language selection is optional or that the skill is intentionally limited to a Chinese-speaking context. Under the stated policy, forcing a specific language without user opt-in can be a locale-policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

This code persists user session content, including chat_id and answers, to a JSON file on disk. While the function has an internal docstring, there is no user-facing prompt, log, or visible disclosure in this file that informs users their progress and answers are being stored.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

User-visible text throughout the file, including the module description and printed test output, is written only in Chinese. This imposes a fixed language choice with no indication of user selection, opt-in, or documented locale restriction.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The markdown states that progress is automatically saved and later describes local storage locations, but it does not give a user-facing warning near the usage flow that answering the test will create persisted session/history data. Because personality-test answers are user data, the skill description should more explicitly disclose this behavior before or when users start the test.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The module docstring includes a Chinese-only description of supported channels, which signals a fixed language presentation rather than offering a user language choice. Under the policy, language constraints should be optional or clearly justified; this file does not indicate any opt-in or locale-specific limitation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

This Python file contains natural-language documentation and descriptions exclusively in Chinese, including the module docstring and later returned content, but does not indicate that the skill is region-specific or that users can choose a language. Under the language/locale policy, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

Session deletion is a destructive operation on user data, even if limited to saved progress. While the cancel response says the test was canceled after the fact, the code does not provide advance warning that invoking cancel or finishing will remove stored session state.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.