Back to skill

Security audit

Agent Commerce Migration Guide: Retrofit Your REST APIs for Autonomous Agent Buyers

Security checks for vulnerabilities and agentic risk

Overview

This is a non-executable guide, but some production migration examples could expose credentials or sensitive API data if copied as written.

Treat this as a Review item before installing or following it. It does not auto-run code, but do not copy the shadow traffic or baseline recorder examples into production without strict header allowlists, body redaction, approved destination hosts, dry-run controls for non-idempotent requests, and a policy that raw production captures are not committed to version control. Also fix the identity-verification fail-closed behavior before relying on the adapter for authenticated agent access.

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

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:365
Finding

Agent Identity Verification Can Be Bypassed When the Agent ID Header Is Omitted

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:1969
Finding

Shadow Traffic Replay Forwards Sensitive Credentials and Production Request Data

Content
View full analysis
Response: # Process request normally body = await request.body() response = await call_next(request) # Fire shadow request in background (don't block the response) try: resp_body = ( json.loads(response.body) if hasattr(response, "body") else None ) except (json.JSONDecodeError, ValueError): resp_body = None asyncio.create_task( shadow_validator.shadow_request( endpoint=request.url.path, method=request.method, body=json.loads(body) if body else None, headers=dict(request.headers), legacy_status=response.status_code, legacy_body=resp_body, ) ) return response ``` ### Technical Analysis The filter removes only `Cookie` and `X-CSRF-Token`. Other sensitive headers remain eligible for forwarding, including: - `Authorization` - `X-AP ...[truncated 1892 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:1847
Finding

Baseline Recorder Persists Unredacted API Data and Recommends Committing It to Version Control

Content
View full analysis
list[BaselineCapture]: """Capture multiple baseline responses for statistical comparison.""" captures = [] async with httpx.AsyncClient(timeout=30.0) as client: for _ in range(iterations): start = time.time() if method.upper() == "GET": resp = await client.get( f"{self.base_url}{endpoint}", headers=headers or {}, ) else: resp = await client.request( method, f"{self.base_url}{endpoint}", json=body, headers=headers or {}, ) latency = (time.time() - start) * 1000 try: resp_body = resp.json() except ValueError: resp_body = resp.text capture = BaselineCapture( endpoint=endpoint, method=method, ...[truncated 2875 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 (3)

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 449)May include surrounding context.

md
# Response headers on 402:
X-Price: 0.05
X-Currency: USD
X-Payment-URL: https://api.greenhelix.net/v1/payments/create
X-Payment-Methods: greenhelix-escrow, x402-direct
X-Price-Window: 300  # price valid for 300 seconds

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The surrounding documentation says agent sessions are 'stateless by design' and frames continuity through idempotency keys and request correlation, but the provided example implements AgentSessionStore, an in-memory server-side session registry keyed by generated session IDs. That directly contradicts the stated stateless model and could mislead readers about the migration approach being recommended.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The line states discovery mode 'does not actually process payments,' but the guide's surrounding migration examples prominently implement live escrow verification and payment-enforcing middleware. While the guide is educational, this sentence can be read as describing the shown implementation path even though no discovery-mode-specific code is provided here.

Content

No source excerpt is available for this finding.