Back to skill

Security audit

LadybugDB openCypher

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent local LadybugDB helper with disclosed database access and explicit write controls, and I found no hidden persistence, exfiltration, or deceptive behavior.

Install only if you intend to let an agent inspect and run Cypher against local LadybugDB files. Treat queries as code: review COPY, LOAD, CALL, extension use, and file paths, and require explicit approval before using --write or --create on any important database.

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
  • Rogue AgentSelf-Modification, Session Persistence
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (7)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description suggests operational database tooling for working with LadybugDB graphs and openCypher queries. However, the provided code does not design schemas, import data, run/debug queries, manage transactions, perform full-text search, or adapt Neo4j queries. Its sole function is to validate the local Python environment and Ladybug bindings version/API compatibility. While this could be a supporting helper, the chunk’s primary behavior is materially different from the declared skill purpose and represents undeclared environment-checking capability rather than graph/query functionality.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill clearly instructs use of local Python scripts and shell execution against user-supplied database and query paths, yet it declares no explicit tool scope such as permissions or allowed-tools. That mismatch increases the chance an agent can perform filesystem access and command execution without clear policy boundaries or user visibility, which is risky in a skill that can open databases, read files, and perform writes when flags are added.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

md
- **Graph modelling:** define typed node and relationship tables, primary keys, direction, properties and multiplicity.
- **Data workflows:** import CSV, Parquet or dataframe data; use parameterized queries and explicit transactions; verify persistent results and parallel relationships.
- **Query development:** write bounded traversals and shortest-path queries, debug counts and scope, and adapt Neo4j queries to LadybugDB semantics.
- **Full-text search:** define and query indexes using the LadybugDB FTS extension, with guidance on prerequisites and procedure arguments.
- **Python execution:** check the selected environment and run Cypher with read-only defaults, explicit write/create options, timeouts and bounded result previews.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/test_helpers.py (reported line 23)May include surrounding context.

python
self.db = Path(self.temp.name) / "test.lbdb"

    def run_query(self, query, *options):
        return subprocess.run([sys.executable, str(SCRIPTS / "run_cypher.py"),
                               str(self.db), "-c", query, *options],
                              capture_output=True, text=True, timeout=45)

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/test_helpers.py (reported line 35)May include surrounding context.

python
self.assertEqual(result.returncode, 0, result.stderr)

    def test_environment(self):
        result = subprocess.run([sys.executable, str(SCRIPTS / "check_env.py")],
                                capture_output=True, text=True, timeout=15)
        self.assertEqual(result.returncode, 0, result.stderr)
        self.assertIn("0.21.2", result.stdout)

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/test_helpers.py (reported line 104)May include surrounding context.

python
params = Path(self.temp.name)/"params.json"
        query.write_text("MATCH (p:Paper {id:$id}) RETURN p.title", encoding="utf-8")
        params.write_text('{"id":"b"}', encoding="utf-8")
        result = subprocess.run([sys.executable,str(SCRIPTS/"run_cypher.py"),str(self.db),
                 "--file",str(query),"--params-file",str(params),"--print-rows"],capture_output=True,text=True,timeout=45)
        self.assertEqual(result.returncode, 0, result.stderr)
        self.assertIn('["B"]',result.stdout)

Dynamic attribute access via getattr()

Low
Category
Dangerous Code Execution
Confidence
50% confidence
Finding

Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.

Content

Scanner excerpt · scripts/check_env.py (reported line 26)May include surrounding context.

python
checks = [(lb, "Database"), (lb, "Connection"), (lb, "AsyncConnection"),
              (lb.Connection, "set_query_timeout"), (lb.Connection, "close"),
              (lb.QueryResult, "get_num_tuples"), (lb.QueryResult, "get_next")]
    missing = [name for owner, name in checks if not callable(getattr(owner, name, None))]
    if missing:
        print("FAIL: missing API: " + ", ".join(missing), file=sys.stderr)
        return 1

Static analysis

No suspicious patterns detected.