Back to skill

Security audit

HeteroMind - Unified Knowledge QA

Security checks for vulnerabilities and agentic risk

Overview

HeteroMind has a coherent data-QA purpose, but its implementation gives generated queries and code too much power compared with the safety controls it claims to enforce.

Install only in an isolated environment with nonprivileged credentials, read-only database copies, trusted SPARQL endpoints, and non-sensitive table files. Do not rely on the documented sandbox/read-only claims until exec-based code execution, SQL validation, endpoint restrictions, and dependency pinning are fixed.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
src/engines/table_qa/multi_stage_engine.py:892
Finding

Unrestricted Execution of LLM-Generated Python Code

Content
View full analysis
', 'exec')` operation only validates Python syntax. It does not reject imports, function calls, attribute traversal, file operations, subprocess creation, infinite loops, or access to sensitive process state. The `safe_execution` co ...[truncated 1742 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
src/engines/nl2sql/base_engine.py:229
Finding

Generated SQL Safety Validation Does Not Enforce Read-Only Queries

Content
View full analysis
Dict: """ Validate SQL syntax and semantics. Args: sql: SQL query string Returns: Validation result with errors/warnings """ import sqlparse validation = { "valid": True, "errors": [], "warnings": [], } # Parse SQL try: parsed = sqlparse.parse(sql) if not parsed: validation["valid"] = False validation["errors"].append("Failed to parse SQL") return validation except Exception as e: validation["valid"] = False validation["errors"].append(f"Parse error: {str(e)}") return validation # Check for dangerous operations sql_upper = sql.upper() dangerous = ["DROP", "DELETE", "TRUNCATE"] for keyword in dangerous: if keyword in sql_upper: validation["warnings"].append( f"Query contains {keyword} - read-only mode enforced" ) # Check for SELECT (read queries only) if not sql_upper.strip().startswith("SELECT"): validation["warnings"].append("Non-SELECT query detected") return validation ``` The validation stage accepts every statement for which `valid` remains true: ```python for sql in candidates: validation = self.validate_sql(sql) if validation["valid"]: valid.append(sql) else: logger.debug(f"Invalid SQL: {validation['errors']}") ``` The selected SQL is then executed directly: ```python conn = sqlite3.connect(connection) cursor = conn.cursor() cursor.execute ...[truncated 2553 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
src/engines/nl2sparql/multi_stage_engine.py:739
Finding

Caller-Controlled SPARQL Endpoint Permits Server-Side Request Forgery

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
requirements.txt:3
Finding

Mutable and Unnecessary Third-Party Dependencies Create Supply-Chain Risk

Content
View full analysis
=6.0 pydantic>=2.0 # Async support aiohttp>=3.9.0 # LLM Integration (optional - choose your provider) openai>=1.0.0 # anthropic>=0.18.0 # For Claude # azure-ai-openai>=1.0.0 # For Azure OpenAI # SQL Engines sqlparse>=0.4.0 sqlalchemy>=2.0.0 # git+https://github.com/HKUSTDial/DeepEye-SQL.git # DeepEye-SQL (when available) # SPARQL Engines rdflib>=6.0.0 sparqlwrapper>=2.0.0 # Table QA pandas>=2.0.0 pandasai>=2.0.0 duckdb>=0.9.0 openpyxl>=3.1.0 # For Excel support # Testing pytest>=7.4.0 pytest-asyncio>=0.21.0 # Utilities python-dotenv>=1.0.0 # For environment variables logging>=0.5.1 ``` The documented installation command is: ```bash cd HeteroMind pip install -r requirements.txt ``` ### Technical Analysis Every active dependency uses an unrestricted lower-bound constraint rather than an exact reviewed version. No lock file or package hashes were identified in the audited project structure. Consequently, two installations performed at different times may install materially different dependency trees. The dependency named `logging` is especially unnecessary because Python provides `logging` in its standard library and the project imports that standard module. Installing a separate package with the same top-level purpose expands the package-resolution and module-shadowing attack surface without a demonstrated functional requirement. The requirements file also combines runtime, optional, and testing packages, increasing the number of packages installed in production. The commented Git dependency is not currently installed and therefore is not treated as an active vulnerability, but it should not be enabled without pinning a reviewed commit. ### Atta ...[truncated 1261 chars]
Remediation
View remediation
=0.5.1` and use Python’s standard-library `logging` module. 2. Separate dependencies into minimal runtime, optional provider, development, and testing groups. 3. Generate and commit a lock file containing exact reviewed versions and transitive dependencies. 4. Require package hashes during deployment, such as through a hash-locked requirements file. 5. Install packages only from a trusted, authenticated package index. 6. Use automated dependency scanning and promptly review security advisories. 7. Rebuild the lock file through a controlled review process rather than automatically accepting all updates. 8. If the commented Git dependency is ever enabled, pin it to a specific reviewed commit hash rather than a branch or mutable tag. 9. Perform installations in an isolated virtual environment or container under a nonprivileged account. ]]>
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (115)

Unvalidated Output Injection

High
Category
Output Handling
Confidence
99% confidence
Finding

Executing generated_code with exec is direct code injection risk because the input originates from a model that can be influenced by malicious prompts or poisoned context. In a heterogeneous QA skill with filesystem access, database connectivity, and external endpoints, successful injection could read secrets, pivot to network resources, or tamper with local analysis results.

Content

Scanner excerpt · SECURITY.md (reported line 74)May include surrounding context.

}

Execute in restricted scope

exec(generated_code, safe_scope)

text

**SQL Execution:**

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 · README.md (reported line 318)May include surrounding context.

Setup

bash
# Create .env file (NEVER commit to git)
cp .env.example .env
chmod 600 .env  # Restrict permissions

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 · README.md (reported line 319)May include surrounding context.

Setup

bash
# Create .env file (NEVER commit to git)
cp .env.example .env
chmod 600 .env  # Restrict permissions

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 · SECURITY.md (reported line 240)May include surrounding context.

Setup

bash
# Create .env file (NEVER commit to git)
cp .env.example .env
chmod 600 .env  # Restrict permissions

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 · SECURITY.md (reported line 242)May include surrounding context.

Setup

bash
# Create .env file (NEVER commit to git)
cp .env.example .env
chmod 600 .env  # Restrict permissions

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 · SECURITY.md (reported line 252)May include surrounding context.

Setup

bash
# Create .env file (NEVER commit to git)
cp .env.example .env
chmod 600 .env  # Restrict permissions

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 · SKILL.md (reported line 292)May include surrounding context.

Setup

bash
# Create .env file (NEVER commit to git)
cp .env.example .env
chmod 600 .env  # Restrict permissions

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 · SKILL.md (reported line 298)May include surrounding context.

Setup

bash
# Create .env file (NEVER commit to git)
cp .env.example .env
chmod 600 .env  # Restrict permissions

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 · SECURITY.md (reported line 241)May include surrounding context.

bash
# Create .env file (NEVER commit to git)
cp .env.example .env
chmod 600 .env  # Restrict permissions

# Edit with your credentials

Credential Access

High
Category
Privilege Escalation
Confidence
88% confidence
Finding

The documented command export $(cat .env | xargs) is unsafe because it can misparse values, expose secrets via shell history/process inspection, and execute unexpectedly if the file contents are not strictly controlled. In practice, users may copy this pattern into environments where .env content includes spaces, shell metacharacters, or untrusted modifications.

Content

Scanner excerpt · SECURITY.md (reported line 245)May include surrounding context.

md
chmod 600 .env  # Restrict permissions

# Edit with your credentials
nano .env

# Load environment
export $(cat .env | xargs)

Credential Access

High
Category
Privilege Escalation
Confidence
92% confidence
Finding

The instruction to echo the API key for verification encourages displaying secrets directly in the terminal, screen recordings, shell scrollback, or session logs. This increases the risk of accidental disclosure of high-value credentials.

Content

Scanner excerpt · SECURITY.md (reported line 248)May include surrounding context.

md
nano .env

# Load environment
export $(cat .env | xargs)

# Verify
echo $DEEPSEEK_API_KEY  # Should show value

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

If the actual implementation is only a narrow schema-formatting utility rather than a full heterogeneous QA system, the mismatch can mislead users about what data will be accessed and what guarantees exist. Misrepresentation of capability is especially risky in agent skills because activation and approval may rely on the declared purpose rather than audited code.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

If the actual implementation is only a narrow schema-formatting utility rather than a full heterogeneous QA system, the mismatch can mislead users about what data will be accessed and what guarantees exist. Misrepresentation of capability is especially risky in agent skills because activation and approval may rely on the declared purpose rather than audited code.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

If the actual implementation is only a narrow schema-formatting utility rather than a full heterogeneous QA system, the mismatch can mislead users about what data will be accessed and what guarantees exist. Misrepresentation of capability is especially risky in agent skills because activation and approval may rely on the declared purpose rather than audited code.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

If the actual implementation is only a narrow schema-formatting utility rather than a full heterogeneous QA system, the mismatch can mislead users about what data will be accessed and what guarantees exist. Misrepresentation of capability is especially risky in agent skills because activation and approval may rely on the declared purpose rather than audited code.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

If the actual implementation is only a narrow schema-formatting utility rather than a full heterogeneous QA system, the mismatch can mislead users about what data will be accessed and what guarantees exist. Misrepresentation of capability is especially risky in agent skills because activation and approval may rely on the declared purpose rather than audited code.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

If the actual implementation is only a narrow schema-formatting utility rather than a full heterogeneous QA system, the mismatch can mislead users about what data will be accessed and what guarantees exist. Misrepresentation of capability is especially risky in agent skills because activation and approval may rely on the declared purpose rather than audited code.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

If the actual implementation is only a narrow schema-formatting utility rather than a full heterogeneous QA system, the mismatch can mislead users about what data will be accessed and what guarantees exist. Misrepresentation of capability is especially risky in agent skills because activation and approval may rely on the declared purpose rather than audited code.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

If the actual implementation is only a narrow schema-formatting utility rather than a full heterogeneous QA system, the mismatch can mislead users about what data will be accessed and what guarantees exist. Misrepresentation of capability is especially risky in agent skills because activation and approval may rely on the declared purpose rather than audited code.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

If the actual implementation is only a narrow schema-formatting utility rather than a full heterogeneous QA system, the mismatch can mislead users about what data will be accessed and what guarantees exist. Misrepresentation of capability is especially risky in agent skills because activation and approval may rely on the declared purpose rather than audited code.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

If the actual implementation is only a narrow schema-formatting utility rather than a full heterogeneous QA system, the mismatch can mislead users about what data will be accessed and what guarantees exist. Misrepresentation of capability is especially risky in agent skills because activation and approval may rely on the declared purpose rather than audited code.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

If the actual implementation is only a narrow schema-formatting utility rather than a full heterogeneous QA system, the mismatch can mislead users about what data will be accessed and what guarantees exist. Misrepresentation of capability is especially risky in agent skills because activation and approval may rely on the declared purpose rather than audited code.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
85% confidence
Finding

The instruction export $(cat .env | xargs) is an unsafe pattern for loading secrets because it can mis-handle special characters, expose values in shell history/process context, and encourage casual plaintext secret handling. In shared or logged shell environments, this increases the likelihood of credential leakage.

Content

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

md
cp .env.example .env

# Edit with your credentials
nano .env

# Load environment
export $(cat .env | xargs)

Possible Typosquatting: 'pandasai' resembles popular package 'pandas'

High
Category
Supply Chain
Confidence
70% confidence
Finding

Package name closely resembles a popular package, suggesting possible typosquatting. Attackers publish malicious packages with similar names to trick developers into installing them.

Content

No source excerpt is available for this finding.

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 · src/classifier/rule_detector.py (reported line 135)May include surrounding context.

python
logger.debug(f"Rule-based detection: {source_scores}")
        
        return RuleBasedScore(
            source_scores=source_scores,
            matched_keywords=matched_keywords,
            matched_patterns=matched_patterns,

Static analysis

Detected: suspicious.exposed_secret_literal

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
src/engines/nl2sparql/multi_stage_engine.py:188

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
src/engines/nl2sql/multi_stage_engine.py:198

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
src/engines/table_qa/multi_stage_engine.py:207

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
USAGE.md:115