Back to skill

Security audit

power-automate-debug

Security checks for vulnerabilities and agentic risk

Overview

The skill is useful for Power Automate troubleshooting, but it can modify and re-run live automations and expose sensitive run payloads without strong consent or redaction guidance.

Install only if you are comfortable giving the agent access to live Power Automate diagnostics and repair tools. Before using it on production flows, require explicit approval before any update, resubmit, or trigger action; review possible duplicate side effects such as emails, writes, approvals, or API calls; and avoid placing full unredacted run inputs, outputs, tokens, or business records into agent-visible logs or prompts.

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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:45
Finding
Unredacted Sensitive Flow Data Sent to a Third-Party Service and Exposed in Agent Output<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:45-55`, `SKILL.md:151-177`, and `SKILL.md:267-278` **Vulnerability Type**: Sensitive-data exposure through external transmission and unredacted diagnostic output **Risk Level**: Medium ### Complete Code Snippet ```python import json, urllib.request MCP_URL = "https://mcp.flowstudio.app/mcp" MCP_TOKEN = "<YOUR_JWT_TOKEN>" def mcp(tool, **kwargs): payload = json.dumps({"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": tool, "arguments": kwargs}}).encode() req = urllib.request.Request(MCP_URL, data=payload, headers={"x-api-key": MCP_TOKEN, "Content-Type": "application/json", "User-Agent": "FlowStudio-MCP/1.0"}) try: resp = urllib.request.urlopen(req, timeout=120) ``` ```python # Get the root failing action's full inputs and outputs root_action = err["failedActions"][-1]["actionName"] detail = mcp("get_live_flow_run_action_outputs", environmentName=ENV, flowName=FLOW_ID, runName=RUN_ID, actionName=root_action) if len(detail) > 1: print(f"{root_action} returned {len(detail)} repetitions; inspect iteration indexes") out = detail[0] if detail else {} print(f"Action: {out.get('actionName')}") print(f"Status: {out.get('status')}") # For HTTP actions, the real error is in outputs.body if isinstance(out.get("outputs"), dict): status_code = out["outputs"].get("statusCode") body = out["outputs"].get("body", {}) print(f"HTTP {status_code}") print(json.dumps(body, indent=2)[:500]) # Error bodies are often nested JSON strings — parse them if isinstance(body, dict) and "error" in body: err_detail = body["error"] if isinstance(err_detail, str): err_detail = json.loads(err_detail) print(f"Error: {err_detail.get('message', err_detail)}") # For expression errors, the error is in the error field if out.get("error"): print(f"Error: {out['e ...[truncated 3365 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Require explicit operator authorization before retrieving complete runtime inputs or outputs, especially for production flows. 2. Use a metadata-first diagnostic process: - Retrieve action names, status, timestamps, and error codes first. - Request detailed payloads only for the minimum set of actions needed. - Prefer selected fields over complete input and output objects. 3. Add recursive redaction before printing or returning data. At minimum, mask keys matching: - `authorization` - `cookie` and `set-cookie` - `token`, `access_token`, and `refresh_token` - `api-key`, `apikey`, and `x-api-key` - `password`, `secret`, and `client_secret` - `connectionString` 4. Redact bearer tokens and credential-like values by pattern, even when their enclosing field names are unknown. 5. Replace direct `print()` calls with a safe rendering function that applies redaction, field allowlisting, and bounded output. 6. Do not include full runtime payloads in agent prompts or persistent logs by default. 7. Store the MCP JWT in a protected environment variable or secret manager rather than encouraging users to place it directly in source code. 8. Document the FlowStudio trust boundary, data handling, retention policy, and the types of production data that may be transmitted. 9. Prefer test or sanitized runs when investigating issues that do not require production payloads. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:385
Finding
Unconditional Production Flow Replay Can Repeat Non-Idempotent Side Effects<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:385-404` and `SKILL.md:411-415` **Vulnerability Type**: Unsafe replay of production automation without confirmation or side-effect analysis **Risk Level**: Medium ### Complete Code Snippet ```python # Resubmit the failed run — works for ANY trigger type resubmit = mcp("resubmit_live_flow_run", environmentName=ENV, flowName=FLOW_ID, runName=RUN_ID) print(resubmit) # {"resubmitted": true, "triggerName": "..."} # Wait ~30 s then check import time; time.sleep(30) new_runs = mcp("get_live_flow_runs", environmentName=ENV, flowName=FLOW_ID, top=3) print(new_runs[0]["status"]) # Succeeded = done ``` The surrounding guidance states: ```text Use resubmit_live_flow_run to test ANY flow — not just HTTP triggers. resubmit_live_flow_run replays a previous run using its original trigger payload. This works for every trigger type. ``` It also recommends replay for the following cases: ```text Testing a fix on any flow Recurrence / scheduled flow SharePoint / connector trigger ``` ### Technical Analysis The skill presents resubmission of the original run as the standard verification mechanism for any flow. A Power Automate run is not necessarily a pure diagnostic operation. It may send messages, create or modify records, invoke external APIs, submit approvals, provision resources, or initiate other business processes. Replaying the original trigger payload does not guarantee safe reproduction. A failed run may already have completed some upstream actions before reaching the failing action. Resubmission starts a new run and can execute those successful actions again. No check is required for idempotency, downstream side effects, production environment status, or rollback availability. The workflow also performs a live definition update before recommending replay. Both operations are state-changing and should require a separate authorization boundary from read-only diagnosis. ### Attack Path 1. A ...[truncated 1280 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Separate read-only diagnosis from state-changing repair and verification. 2. Require explicit user confirmation immediately before: - Updating a live flow definition - Resubmitting a prior run - Triggering a flow with a custom payload 3. Before replay, inspect the flow definition for non-idempotent actions such as: - Email and messaging actions - Create, update, or delete operations - Approval creation - HTTP methods other than safe read operations - Child-flow invocation - Financial, provisioning, or administrative operations 4. Report the identified side effects to the user and identify actions that may already have succeeded in the failed run. 5. Prefer a sandbox environment, cloned flow, disabled connectors, mocked endpoints, or sanitized test payload. 6. Add idempotency keys, deduplication checks, and replay guards to state-changing actions. 7. Require a rollback or recovery plan before replaying workflows with high-impact side effects. 8. Do not describe replay as safe for “ANY flow.” State that replay is appropriate only after confirming that completed actions are idempotent or that duplicate execution is acceptable. 9. Poll for the newly created run by its unique identity where possible rather than assuming that `new_runs[0]` is the replayed run. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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 (8)

Description-Behavior Mismatch

Medium
Confidence
96% confidence
Finding
The skill is presented as a debugging aid, but it goes beyond read-only diagnostics by instructing the agent to modify live flow definitions via `update_live_flow`. This expands the capability from inspection into production change management, which is risky because an agent troubleshooting a failure could silently alter business logic, credentials usage, or downstream integrations without an explicit safety gate.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The skill provides concrete instructions to update live flows without clearly warning that this may modify production automation and affect real business processes. Absence of a strong caution and approval checkpoint can lead users or agents to apply fixes directly in live environments, potentially breaking workflows, introducing regressions, or causing unauthorized process changes.

Description-Behavior Mismatch

Medium
Confidence
97% confidence
Finding
The skill includes active execution features such as resubmitting prior runs and triggering flows with custom payloads, despite being framed primarily as debugging guidance. In Power Automate, replaying or triggering flows can cause real-world side effects such as duplicate emails, data writes, ticket creation, approvals, or external API calls, so embedding these steps in a debugging skill materially increases operational risk.

Missing User Warnings

Medium
Confidence
98% confidence
Finding
The skill encourages resubmitting previous runs as a standard verification step but does not clearly warn that replaying a failed run may repeat all original side effects against real systems. This is dangerous because a failed run may already have partially executed, and resubmission can duplicate writes, notifications, purchases, or external actions.

Missing User Warnings

Medium
Confidence
98% confidence
Finding
The skill describes triggering flows with custom payloads without prominently warning that this invokes live automations against connected systems. Custom payload testing can create or modify records, call external services, send communications, or bypass normal business controls if used casually during debugging.

Description-Behavior Mismatch

Medium
Confidence
94% confidence
Finding
The skill is described as a debugging aid, but this workflow explicitly instructs the agent to change a live flow with `update_live_flow` and then rerun it. That crosses from diagnosis into state-changing operations, which can cause unintended production changes, trigger external side effects, or let a user obtain modification behavior under the guise of troubleshooting.

Description-Behavior Mismatch

Medium
Confidence
90% confidence
Finding
The post-fix checklist operationalizes a full repair loop: accept a new definition, resubmit a run, poll for completion, and verify downstream effects. In a skill framed as debugging-only, these steps encourage execution against live systems and may trigger emails, child flows, SharePoint writes, or other production actions without a separately authorized repair workflow.

Context-Inappropriate Capability

Low
Confidence
75% confidence
Finding
This section discusses failures that occur when an agent rebuilds or modifies an Outlook action via `update_live_flow`, then provides guidance on alternative dynamic-option tooling. While related to troubleshooting, it introduces design/change guidance for connector configuration rather than purely analyzing failing runs.

Static analysis

No suspicious patterns detected.