Back to skill

Security audit

Async Agent Commerce: Event-Driven Patterns for Autonomous Transactions

Security checks for vulnerabilities and agentic risk

Overview

The skill is a non-executing educational guide, but its production-framed examples automate financial escrow release and disputes without enough validation or user control.

Review carefully before installing or using this as implementation guidance. Treat the code as illustrative only: keep it in sandbox, restrict API origins, use scoped credentials, verify signed/authorized event sources, check authoritative escrow state before release or dispute actions, and add manual approval or strict policy limits for real-money settlement.

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:235
Finding

Bearer Credential Can Be Sent to a Caller-Controlled API Endpoint

Content
View full analysis
list of handlers self._handlers: Dict[str, List[EventHandler]] = defaultdict(list) self._dead_letter_handler: Optional[EventHandler] = None # Processing state self._cursors: Dict[str, str] = {} self._processed_ids: Set[str] = set() self._semaphore = asyncio.Semaphore(max_concurrent_handlers) self._running = False self._session: Optional[aiohttp.ClientSession] = None self._tasks: List[asyncio.Task] = [] async def start(self) -> None: """Start the event bus. Polls for events and dispatches to handlers.""" self._running = True self._session = aiohttp.ClientSession( headers={ "Content-Type": "application/json", "Authorization": f"Bearer {self.api_key}", } ) ``` Requests are subsequently sent using the configurable value: ```python async with self._session.post( f"{self.base_url}/v1", json={ "tool": "publish_event", "input": { "agent_id": self.agent_id, "event_type": event.event_type, "payload": json.dumps(event.to_dict()), }, }, ) as resp: ``` ### Technical Analysis The class accepts `base_url` from its caller without validating its scheme, hostname, port, or origin. It then configures a reusable HTTP session whose default headers include the GreenHelix bearer credential. Every request made through this session therefore carries the credential to ...[truncated 1821 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:2230
Finding

Untrusted Lifecycle Events Can Trigger Automatic Escrow Release

Content
View full analysis
None: """Track a newly created escrow.""" escrow_id = event.payload.get("escrow_id") self._escrows[escrow_id] = { "escrow_id": escrow_id, "amount": event.payload.get("amount"), "counterparty_id": event.payload.get( "counterparty_id" ), "conditions": event.payload.get("conditions", {}), "sla_met": False, "delivery_confirmed": False, "created_at": event.timestamp, "correlation_id": event.correlation_id, } logger.info(f"Tracking escrow: {escrow_id}") ``` Separate events mark the required conditions as satisfied: ```python async def _on_sla_evaluation_complete( self, event: Event ) -> None: """Handle SLA evaluation completion.""" sla_id = event.payload.get("sla_id") escrow_id = event.payload.get("escrow_id") compliant = event.payload.get("compliant", False) if escrow_id not in self._escrows: return escrow = self._escrows[escrow_id] if compliant: escrow["sla_met"] = True logger.info( f"SLA met for escrow {escrow_id} " f"(SLA: {sla_id})" ) await self._check_release_conditions(escrow_id) else: breach_data = event.payload.get("breach_data", {}) ...[truncated 4579 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (6)

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The AsyncEventBus docstring promises guaranteed delivery and ordered processing, but the implementation only polls, keeps an in-memory processed-ID set, and does not persist acknowledgments or enforce ordering. In a commerce/escrow context, overstating delivery guarantees can cause developers to trust the sample for financial workflows where dropped, duplicated, or reordered events can lead to inconsistent settlement or compensation behavior.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

md
"""

    def __init__(self, api_key: str, agent_id: str,
                 base_url: str = "https://api.greenhelix.net/v1",
                 poll_interval: float = 1.0,
                 max_concurrent_handlers: int = 10):
        self.api_key = api_key

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The guide claims in-order processing within a partition, but the code does not buffer, sort, or validate sequence_number before dispatch. In an event-driven commerce system, out-of-order processing can cause premature escrow release, incorrect compensation order, or stale state transitions, especially when examples are presented as production-ready.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The guide includes automated escrow release and dispute-opening logic for financial operations, but it lacks a strong warning that changing the base URL or credentials can make the examples operate against real environments. In a skill marketed for autonomous transactions and described as production-oriented, this omission materially increases the risk of accidental real-money transfers, disputes, or ledger mutations by users who treat the examples as safe to run.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The surrounding documentation says matching handlers are dispatched concurrently, but _dispatch iterates over handlers and awaits each one inside the loop. This is an active contradiction between the stated execution model and the implemented behavior, which affects expectations around throughput and ordering.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The inline comment says 'SLA cancellation', which implies the compensation cancels the SLA, but the function only records an sla_cancelled transaction. Because the code leaves the SLA in place and merely logs an audit record, the comment is misleading about the real effect of the compensation.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.