Back to skill

Security audit

Flutter Master

Security checks for vulnerabilities and agentic risk

Overview

This Flutter auditing skill is broadly scoped and includes a local scan script, but its behavior is coherent with its stated development-review purpose.

Safe to install for Flutter development and audits, but use it when you actually want Flutter-specific help. If you run the bundled audit script, review output locally and avoid pasting or publishing raw reports until any detected keys, tokens, or passwords are redacted or rotated.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/audit_scan.sh:62
Finding

Potential secrets are disclosed verbatim in audit output

Content
View full analysis

Vulnerability Details

File Location: scripts/audit_scan.sh, lines 62-63
Vulnerability Type: Sensitive information exposure through diagnostic output
Risk Level: Medium

Vulnerable Code

bash
echo "--- Potential hardcoded secrets/keys ---"
grep -rniE --include="*.dart" '(api[_-]?key|secret|token|password)\s*=\s*['"'"'"][A-Za-z0-9_\-]{12,}['"'"'"]' lib/ 2>/dev/null || echo "(none found)"

Technical Analysis

The scan searches Dart files for assignments resembling API keys, secrets, tokens, or passwords. Because grep prints the entire matching source line, any detected credential value is emitted verbatim to standard output.

The Skill describes this output as a plain-text audit report. Consequently, a secret already present in source code can be duplicated into terminal scrollback, CI logs, captured Agent context, build artifacts, or stored reports. This increases its exposure beyond users and systems that have direct repository access.

The issue does not independently grant system privileges or execute attacker-controlled code. Exploitation requires a matching sensitive value to exist in a Dart file and the audit script to be run.

Attack Path

  1. A Dart file under lib/ contains a credential assignment matching the regular expression, such as:
    dart
    const apiKey = 'ExampleSecretValue123';
    
  2. A developer, CI job, or AI Agent runs:
    bash
    bash scripts/audit_scan.sh /path/to/flutter/project
    
  3. grep matches the assignment and prints the complete source line.
  4. The credential is retained in one or more secondary locations, such as CI logs, terminal history, Agent transcripts, or an audit report.
  5. Anyone with access to those secondary locations may recover and misuse the exposed credential according to its existing permissions.

Impact Assessment

The maximum obtainable access is determined by the privileges of the disclosed credential. Depending on that credential, an unauthorized party co ...[truncated 325 chars]

Remediation
View remediation

Remediation Suggestions

Do not include matching source content in scan output. Report only the file path and line number, or redact the credential value before displaying the result.

A safer file-and-line-only implementation is:

bash
grep -rnlE --include="*.dart" \
  '(api[_-]?key|secret|token|password)\s*=\s*['"'"'"][A-Za-z0-9_\-]{12,}['"'"'"]' \
  lib/ 2>/dev/null || echo "(none found)"

For line-level reporting without source disclosure, process matching files separately and output only normalized metadata. Additional hardening should include:

  • Treat audit output as potentially sensitive and restrict its retention and access.
  • Mask credential-like values before writing CI logs or reports.
  • Avoid uploading raw scan output as a public or broadly accessible artifact.
  • If a real credential is detected, revoke or rotate it immediately and inspect version-control history and prior logs for exposure.
  • Move sensitive server-side credentials out of client applications rather than relying solely on obfuscation or build-time injection.
Vulnerability Patterns
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (4)

Vague Triggers

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The trigger scope is intentionally expansive, instructing use for virtually any Flutter-related mention and a wide range of task types. In an agent system, overly broad activation can cause unnecessary or inappropriate skill invocation, increasing prompt-surface exposure, consuming context budget, and potentially steering responses when the user did not ask for deep Flutter analysis.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The guidance to 'use proactively even for small requests' encourages invocation without clear limiting conditions. That can lead the agent to over-apply this skill in marginal cases, causing unnecessary context loading and increasing the chance that the skill's embedded instructions influence unrelated or only tangentially related tasks.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% 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 · references/security.md (reported line 22)May include surrounding context.

md
## Permissions

- Request only the permissions actually needed, and request them contextually (at the point of use) rather than all upfront — this is both better UX and reduces the "why does this app want X" red flag that gets apps flagged in store review.
- Check `AndroidManifest.xml` and `Info.plist` for permissions that are declared but no longer used by any code path (common after feature removal).

## Obfuscation

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% 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 · references/security.md (reported line 31)May include surrounding context.

md
## Permissions

- Request only the permissions actually needed, and request them contextually (at the point of use) rather than all upfront — this is both better UX and reduces the "why does this app want X" red flag that gets apps flagged in store review.
- Check `AndroidManifest.xml` and `Info.plist` for permissions that are declared but no longer used by any code path (common after feature removal).

## Obfuscation

Static analysis

No suspicious patterns detected.