Skip to content

Security & Permissions ​

Four-Layer Permission Model ​

LayerTypical scenarioImplementation
No loginWebsite home, marketplace listNo auth dependency injected
Login requiredProfile, my ordersDepends(get_current_user)
Rule-based authUser, role, plugin managementrequire_permission("...")
Data scopeAccess only own plugins or dataService layer filters by user_id

The frontend v-permission directive only hides buttons — it cannot replace backend permission checks. Plugin admin APIs must re-validate permissions and resource ownership on the server.

Key Storage ​

SMTP authorization codes, DeepSeek API keys and LemPay merchant keys are stored using ApeAdmin's core encryption capability. Admin APIs only return a "configured" status, never the plaintext. In production, write keys through controlled configuration; never put keys inside plugin ZIPs, logs, Markdown docs or frontend code.

Uploaded Package Checks ​

Plugin ZIPs are not extracted into the running directory during analysis, and Python/JavaScript inside them is never executed. The platform checks:

  • Path traversal, absolute paths and symbolic links
  • Encrypted files, file count, total extracted size and abnormal compression ratios
  • Required plugin.json fields and version consistency
  • Dynamic code execution, system commands, outbound network requests and suspected hard-coded keys

Static checks and AI analysis only provide review-support information; the final go-live decision must be made by an admin after review and publishing.

Website Content ​

Navigation links only allow controlled in-site paths or explicitly permitted HTTPS addresses. User-submitted Markdown, images, demo links and plugin docs must pass format validation and HTML sanitization before being shown publicly.

ApeHub Plugin Ecosystem