Back to skill

Security audit

Directus.io Headless CMS

Security checks for vulnerabilities and agentic risk

Overview

This Directus helper skill is mostly normal documentation, but several copyable examples handle credentials, schema changes, CMS HTML, and external services in ways that could expose data or damage a Directus project if followed as-is.

Install only if you are comfortable treating this as a Directus reference that needs security review before copying examples. Use scoped tokens, avoid secrets in URLs or command arguments, sanitize CMS HTML, pin npx packages and container images, review schema diffs before applying them, and add explicit approval/privacy checks before sending CMS content to third-party services.

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

T09 · Insecure Skill Coding Practices

Error
Location
references/astro-integration.md:170
Finding

Unsanitized CMS HTML Rendering Enables Stored Cross-Site Scripting

Content
View full analysis

{page.title}

``` A second instance uses the same unsafe rendering pattern: ```astro {post.cover_image && ( {post.title} )}

{post.title}

{typeof post.author === 'object' && post.author && (

By {post.author.name}

)} {new Date(post.date_created).toLocaleDateString()} ``` ### Technical Analysis Astro's `set:html` directive inserts a value as raw HTML and bypasses normal output escaping. The examples render `page.content` and `post.content` obtained from Directus without applying an allowlist-based HTML sanitizer. Although CMS content may be considered trusted in some deployments, content can also originate from editors, imports, API clients, automation flows, or compromised accounts. Any such source capable of storing HTML could inject script elements, event-handler attributes, dangerous URLs, malicious forms, or embedded active content. This network behavior is not itself covert exfiltration: retrieving content from a user-configured Directus server is necessary for the declared functionality. The vulnerability arises when the retrieved content is treated as executable markup without validation. ### Attack Path 1. An attacker obtains content-write permission through a compromised editor account, exposed API token, vulnerable integration, or improperly configured Directus role. 2. The attacker stores malicious HTML in the `content` field of a page or post. 3. The Astro application retrieves the record from Directus. 4 ...[truncated 1041 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
references/astro-integration.md:365
Finding

Reusable Bearer Token Accepted Through a Preview URL

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
references/troubleshooting.md:404
Finding

Unauthenticated On-Demand Revalidation Endpoint

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
references/typescript-patterns.md:246
Finding

Administrative Password Exposed Through Command-Line Arguments

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
references/extensions.md:37
Finding

Unpinned Executable Packages and Mutable Container Images

Content
View full analysis
Remediation
View remediation
`. - Use automated dependency scanning, but require review and testing before updating pinned versions or digests. - Run containers as non-root, minimize mounted directories, use read-only filesystems where practical, and restrict network access. - Separate development, CI, and production credentials so a compromised build dependency cannot access production resources. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (45)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| **Troubleshooting** | `references/troubleshooting.md` | Common errors, debugging, CORS issues, Docker problems, migration headaches, performance tips |

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/sdk-and-api.md (reported line 31)May include surrounding context.

md
| `rest()` | Enables REST API requests via `client.request()` |
| `graphql()` | Enables GraphQL queries via `client.query()` |
| `authentication(mode)` | Manages login/logout/refresh. Modes: `'json'`, `'session'`, `'cookie'` |
| `staticToken(token)` | Sets a fixed access token for all requests |
| `realtime(options)` | Enables WebSocket subscriptions |

### Client Creation Patterns

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/sdk-and-api.md (reported line 448)May include surrounding context.

md
| Resource | Endpoint |
|---|---|
| Items | `GET/POST/PATCH/DELETE /items/{collection}` |
| Single Item | `GET/PATCH/DELETE /items/{collection}/{id}` |
| Singleton | `GET/PATCH /items/{collection}` |
| Files | `GET/POST /files` |

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/sdk-and-api.md (reported line 449)May include surrounding context.

md
| Resource | Endpoint |
|---|---|
| Items | `GET/POST/PATCH/DELETE /items/{collection}` |
| Single Item | `GET/PATCH/DELETE /items/{collection}/{id}` |
| Singleton | `GET/PATCH /items/{collection}` |
| Files | `GET/POST /files` |
| Assets | `GET /assets/{id}` |

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/sdk-and-api.md (reported line 453)May include surrounding context.

md
| Singleton | `GET/PATCH /items/{collection}` |
| Files | `GET/POST /files` |
| Assets | `GET /assets/{id}` |
| Users | `GET/POST/PATCH/DELETE /users` |
| Auth | `POST /auth/login`, `POST /auth/refresh`, `POST /auth/logout` |
| Flows | `GET/POST/PATCH/DELETE /flows` |
| Activity | `GET /activity` |

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/sdk-and-api.md (reported line 455)May include surrounding context.

md
| Assets | `GET /assets/{id}` |
| Users | `GET/POST/PATCH/DELETE /users` |
| Auth | `POST /auth/login`, `POST /auth/refresh`, `POST /auth/logout` |
| Flows | `GET/POST/PATCH/DELETE /flows` |
| Activity | `GET /activity` |
| Schema | `GET /schema/snapshot`, `POST /schema/diff`, `POST /schema/apply` |

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/troubleshooting.md (reported line 59)May include surrounding context.

md
### "Invalid token" Error
Causes and fixes:
- **Token expired**: Access tokens have a short TTL. Refresh with `await client.refresh()` or re-login
- **Token not saved**: After generating a static token in the Data Studio, you MUST click Save on the user profile
- **Wrong token type**: Static tokens go in `staticToken()`, login tokens are managed by `authentication()`
- **SECRET changed**: If you change the `SECRET` env var, all existing tokens are invalidated

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger description is overly broad because it activates not only on explicit Directus requests but also on generic headless CMS integration, content pipeline, and automation questions where Directus is only a possible fit. In an agent routing system, this can cause the wrong specialized skill to engage, leading to irrelevant guidance, reduced safety from bypassing more appropriate skills, or expanded exposure to tool/use paths the user did not intend.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The preview example reads an access token directly from the URL query string and uses it to authorize content access. Tokens in URLs are commonly exposed through browser history, server logs, analytics, referrer headers, screenshots, and shared links, so this pattern can leak credentials and allow unauthorized draft-content access or broader API use depending on token scope.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documentation presents schema apply commands without an explicit warning that they will modify the target instance and may introduce destructive or irreversible changes if used against the wrong environment. In an admin-focused skill, users are likely to copy commands directly, increasing the chance of accidental production impact.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The API example programmatically diffs and applies schema changes to a remote target instance using admin tokens, but it does not warn that this can alter or break the destination environment. Because it is ready-to-run code aimed at administrative automation, omission of safety guidance materially raises the risk of accidental destructive changes or misuse in CI/CD.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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 · references/data-modeling.md (reported line 366)May include surrounding context.

md
}).then(r => r.json());

// Diff against target
const diff = await fetch('https://target.directus.app/schema/diff', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer admin-token',

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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 · references/data-modeling.md (reported line 376)May include surrounding context.

md
}).then(r => r.json());

// Apply diff to target
await fetch('https://target.directus.app/schema/apply', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer admin-token',

Rp1

Medium
Category
MCP Rug Pull
Confidence
88% confidence
Finding

The documentation recommends running npx create-directus-extension@latest, which pulls and executes the newest package version at install time. That creates a supply-chain risk because users may execute unreviewed upstream code, and results are non-reproducible across time. In a developer skill focused on extension creation, this guidance is more dangerous because the command is likely to be copied verbatim and run locally with user privileges.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The sandbox section describes API extensions as isolated for security, then immediately states that the sandbox can be disabled for specific extensions to gain broader functionality. This can give readers a misleading sense of safety and encourage deployment of privileged, unsandboxed extensions without strong warnings, expanding the blast radius to filesystem/module access and potentially full server compromise if an extension is malicious or vulnerable. In the Directus extension context, this is especially relevant because extensions are executable server-side code.

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 · references/flows-and-automation.md (reported line 109)May include surrounding context.

Makes an HTTP request to an external service.

text
Method: GET, POST, PUT, PATCH, DELETE
URL: https://api.example.com/endpoint
Headers: { "Authorization": "Bearer {{$env.API_KEY}}", "Content-Type": "application/json" }
Body: JSON with template variables

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The document gives step-by-step instructions to send CMS content to OpenAI/translation providers but does not warn that article text, metadata, or other records may leave the Directus environment and be processed by third parties. In a CMS/automation skill, this omission can lead users to exfiltrate sensitive, unpublished, regulated, or customer content through normal-looking automation examples.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
95% confidence
Finding

This example explicitly sends post content-derived data to the OpenAI API using an environment-backed bearer token. In the context of a Directus CMS skill, that is potentially dangerous because unpublished or sensitive editorial content may be transmitted off-platform without any accompanying privacy, retention, or compliance warning.

Content

Scanner excerpt · references/flows-and-automation.md (reported line 192)May include surrounding context.

  • Collection: posts
    • Key: {{ $trigger.body.keys[0] }}
  1. Web Request (key: generate): POST to OpenAI
    • URL: https://api.openai.com/v1/chat/completions
    • Headers: { "Authorization": "Bearer {{ $env.OPENAI_API_KEY }}", "Content-Type": "application/json" }
    • Body:
    json

External Transmission

Medium
Category
Data Exfiltration
Confidence
92% confidence
Finding

The DALL·E example sends article-derived prompts to an external image-generation API and then may download resulting assets from provider-hosted URLs. This creates external data transfer and third-party dependency risks that are not called out, which matters in a CMS automation context handling internal content.

Content

Scanner excerpt · references/flows-and-automation.md (reported line 221)May include surrounding context.

Generate Images with DALL·E

Web Request to https://api.openai.com/v1/images/generations:

json
{
  "model": "dall-e-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 · references/astro-integration.md (reported line 643)May include surrounding context.

Netlify:

text
POST https://api.netlify.com/build_hooks/{your-hook-id}

Vercel:

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 · references/flows-and-automation.md (reported line 281)May include surrounding context.

Netlify:

text
POST https://api.netlify.com/build_hooks/{your-hook-id}

Vercel:

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 · references/astro-integration.md (reported line 644)May include surrounding context.

Vercel:

text
POST https://api.vercel.com/v1/integrations/deploy/{your-hook-id}/{your-project-id}

Cloudflare Pages:

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 · references/flows-and-automation.md (reported line 286)May include surrounding context.

Vercel:

text
POST https://api.vercel.com/v1/integrations/deploy/{your-hook-id}/{your-project-id}

Cloudflare Pages:

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 · references/flows-and-automation.md (reported line 291)May include surrounding context.

Cloudflare Pages:

text
POST https://api.cloudflare.com/client/v4/pages/webhooks/deploy_hooks/{your-hook-id}

Static analysis

No suspicious patterns detected.