Back to skill

Security audit

FastAPI Production Patterns

Security checks for vulnerabilities and agentic risk

Overview

This is a documentation-only FastAPI skill with some insecure production examples users should harden before copying.

Install only as general FastAPI reference material. Before using its snippets in real services, replace the JWT secret with secure secret management, avoid returning raw exception details from health endpoints, pin and review dependencies, and check any outbound HTTP examples for sensitive data exposure.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:180
Finding

Unpinned Dependency Installation Creates Supply-Chain Risk

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:195
Finding

Readiness Endpoint Exposes Internal Exception Details

Content
View full analysis
Remediation
View remediation
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 (3)

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

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.

Content

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

md
return users

# Use def for: psycopg2, pymongo, requests (blocking libs)
# FastAPI automatically runs def endpoints in a threadpool
@app.get('/users/sync')
def get_users_sync():
    return sync_db.query('SELECT * FROM users')

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The JWT example is presented as a production authentication pattern but hard-codes SECRET_KEY = "your-secret-key", which can normalize insecure secret handling and lead users to deploy weak or default keys. In an auth context, a predictable or copied secret can allow token forgery and authentication bypass if reused in real deployments.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

This markdown skill teaches OAuth2/JWT handling and later shows outbound HTTP requests, but the document does not warn users about protecting secret keys, avoiding hardcoded credentials, or the privacy implications of sending data to external services. Under the markdown-specific warning rule, examples that affect privacy or system integrity should include some disclosure or cautionary note.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.