T09 · Insecure Skill Coding Practices
- Location
use-cases.md:46- Finding
Unrestricted Caller-Controlled URL Fetch Enables SSRF
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a read-only GenLayer knowledge skill with no hidden execution or persistence, though some illustrative smart-contract examples need safety review before reuse.
This skill is reasonable to install for learning or explaining GenLayer. Do not treat its contract snippets as production-ready: before building from them, add strict authorization, allowlisted data sources, prompt-injection defenses, privacy review, bounded transfers, appeal or human-review paths, and failure handling.
use-cases.md:46Unrestricted Caller-Controlled URL Fetch Enables SSRF
use-cases.md:46Untrusted Web Content Can Manipulate an LLM-Governed Escrow Transfer
use-cases.md:114Caller-Controlled Dispute Evidence Can Bias Fund Distribution
The guide includes direct fund transfer functionality without cautioning that transfers are irreversible, authorization-sensitive, and potentially exploitable if exposed through poorly designed public methods. In this context, example code can be copied into production contracts, so missing warnings around access control and failure handling materially increases the chance of unsafe implementations.
The documentation shows sending arbitrary user text to an LLM without disclosing that submitted content may be transmitted to a model provider or external processing layer. This is risky because developers may unknowingly route sensitive user data, contract inputs, or regulated information to third-party AI services and may also overlook prompt-injection and output reliability concerns.
The guide demonstrates fetching external web data inside a contract but does not warn that request contents and derived data may leave the execution environment, be logged by third parties, or introduce privacy and integrity risks. In a smart-contract developer guide, omission of these cautions can lead users to pass sensitive inputs or rely on untrusted off-chain data without validation.
The example performs an outbound request to an external HTTPS endpoint from contract logic, which constitutes external data transmission and reliance on off-chain infrastructure. In a developer guide for intelligent contracts, this is more dangerous than ordinary documentation because readers may normalize sending user-controlled or sensitive data externally and trusting unauthenticated responses in consensus-sensitive logic.
@gl.public.write def get_price(self, symbol: str) -> u256: # Fetch from web API data = gl.web.fetch(f"https://api.example.com/price/{symbol}") price = parse_price(data) return price
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
### The Micro-Dispute Problem
Imagine signing a contract with another human to create an artwork. When receiving it, you notice an extra specification not mentioned during negotiations. A human artist would likely comply without asking for additional payment. But an AI artist? It will immediately request a surcharge.
Now imagine the legal system flooded by thousands of micro-disputes about things humans would never argue about. Often, the mental burden of fighting for something small exceeds the potential reward. But what's a mental burden for an AI? Extra five dollars are extra five dollars. As simple as that.
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.
## Part V: The Consequences
The world is not black or white. Because of the deterministic nature of traditional blockchain VMs, most use cases have remained simplistic. If simple deterministic applications (verifying token transfers) created a market worth trillions, imagine what emerges from consensus designed to be **non-deterministic**.
Examples:
- Prediction markets on subjective matters
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.
## Part V: The Consequences
The world is not black or white. Because of the deterministic nature of traditional blockchain VMs, most use cases have remained simplistic. If simple deterministic applications (verifying token transfers) created a market worth trillions, imagine what emerges from consensus designed to be **non-deterministic**.
Examples:
- Prediction markets on subjective matters
This documentation showcases automatic escrow release based on web-fetched proof data and LLM evaluation, but it does not mention failure modes such as prompt manipulation, forged proof sources, ambiguous requirements, or incorrect model judgments. In a blockchain/contract context, readers may treat the example as a safe design pattern and implement irreversible financial logic without human review or cryptographic verification.
The example promotes autonomous treasury rebalancing using external market data and LLM-generated allocation decisions without guardrails or risk disclosures. This can normalize a dangerous pattern where manipulated data, model error, or consensus drift leads to direct financial losses through automatic asset movement.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
@gl.public.write
def auto_rebalance(self):
# Fetch market data
market_data = gl.web.fetch("https://api.example.com/market")
# AI determines optimal allocation
allocation = gl.llm.complete(
The dispute-resolution example automatically distributes funds based on an LLM's assessment of free-form evidence, but omits warnings about bias, adversarial evidence, inconsistent reasoning, and appeal/fairness concerns. In this context, the omission is risky because the example couples subjective AI judgment directly to financial settlement.
The KYC/compliance section encourages AI-based document verification and risk scoring across jurisdictions without addressing privacy, consent, retention, cross-border transfer, or regulatory error risks. That omission can lead adopters to process sensitive identity data insecurely or unlawfully.
No suspicious patterns detected.