Back to skill

Security audit

flutter-hive-database

Security checks for vulnerabilities and agentic risk

Overview

This Flutter Hive code generator appears purpose-built rather than malicious, but it needs review because crafted model JSON can make it write or inject unsafe source code beyond the intended scope.

Review before installing or running this skill. Use only model JSON you wrote or fully trust, avoid copied entity definitions from untrusted sources, and inspect generated Dart files before building the app. The publisher should add strict schema validation and path containment checks before this is treated as routine code generation.

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
scripts/generate.py:410
Finding

Entity Name Path Traversal Allows Writes Outside the Flutter Project

Content
View full analysis
Remediation
View remediation
Path: base = base.resolve() destination = (base / relative).resolve() try: destination.relative_to(base) except ValueError: raise ValueError(f"Output path escapes destination directory: {destination}") return destination ``` 4. Apply containment checks to both `model_file` and `repo_file`, rather than relying solely on input validation. 5. Avoid calling `mkdir()` until after containment validation succeeds. 6. Add regression tests covering `../`, nested traversal, absolute paths, backslashes, mixed separators, encoded or Unicode separator variants, and valid PascalCase names. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/generate.py:262
Finding

Unvalidated Entity Schema Enables Generated Dart Source Injection

Content
View full analysis
str: name = entity["name"] fields = entity["fields"] fields_code = "".join( f" final {f['type']}{nullable_suffix(f)} {f['name']};\n" for f in fields ) ctor_params = "\n".join( f" {'this' if f.get('nullable', True) else 'required this'}.{f['name']}," for f in fields ) to_json_lines = ",\n".join( f" '{f['name']}': {to_json_expr(f)}" for f in fields ) from_json_lines = ",\n".join( f" {f['name']}: {from_json_expr(f)}" for f in fields ) copy_with_params = ", ".join( f"{f['type']}{'?' if f.get('nullable', True) else '?'} {f['name']}" for f in fields ) copy_with_body = ",\n ".join( f"{f['name']}: {f['name']} ?? this.{f['name']}" for f in fields ) to_str = ", ".join(f"{f['name']}: ${{{f['name']}}}" for f in fields) eq_body = " && ".join(f"other.{f['name']} == {f['name']}" for f in fields) hash_body = (f"Object.hash({', '.join(f['name'] for f in fields)})" if len(fields) > 1 else f"{fields[0]['name']}.hashCode") return f"""\ /// {name} 数据模型 /// 存储策略:toJson() → Hive Box → fromJson(),无需 TypeAdapter class {name}Model {{ {fields_code} const {name}Model({{ {ctor_params} }}); Map toJson() => {{ {to_json_lines} }}; factory {name}Model.fromJson(Map json) => {name}Model( {from_json_lines} ); {name}Model copyWith({{{copy_with_params}}}) => {name}Model( {copy_with_body}, ); @override String toString() => '{name}({to_str})'; @overri ...[truncated 4006 chars]
Remediation
View remediation
Vulnerability Patterns
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (2)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill instructs the agent to run a local code-generation script and create or modify project files, but it does not declare any explicit tool scope such as allowed-tools or permissions. This mismatch weakens policy enforcement and can cause the skill to receive broader file read/write capabilities than users or reviewers expect, increasing the risk of unintended filesystem access or silent code modification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest description is written entirely in Chinese and gives no indication that the skill supports other languages or that Chinese is a required locale. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicit and justified.

Content

No source excerpt is available for this finding.