Back to skill

Security audit

AIFS - HTTP File system

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent AIFS cloud-storage helper, but it gives agents broad remote read, write, patch, and delete capability without enough user-control guidance.

Review before installing. Use this only when you intentionally want files sent to AIFS.space, avoid sensitive content, prefer least-privilege keys instead of admin keys, and confirm the target path/account before any write, patch, overwrite, or delete operation.

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

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:34
Finding
Bearer API Key Exposed Through Process Command-Line Arguments<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 34–36 **Vulnerability Type**: API credential exposure through process arguments **Risk Level**: Medium ### Vulnerable Code ```bash curl -H "Authorization: Bearer $AIFS_API_KEY" https://aifs.space/api/files ``` The same credential-handling pattern is repeated across the documented read, write, patch, delete, summary, and logging examples. ### Technical Analysis The shell expands `$AIFS_API_KEY` before starting `curl`. Consequently, the complete bearer token can become part of the process command-line arguments. Depending on the operating system, process isolation settings, monitoring configuration, and privileges of other local users or services, command-line arguments may be observable through process inspection facilities, audit logs, diagnostic tooling, or process-monitoring software. Because the value is a bearer credential, possession of the token is sufficient to authenticate without additional proof of identity. The possible permissions are significant because the documentation supports `admin`, `read-write`, `read-only`, and `write-only` key types. ### Attack Path 1. A user configures `AIFS_API_KEY` and invokes one of the documented `curl` commands. 2. The shell expands the variable into the `Authorization` header before executing `curl`. 3. A malicious or compromised local process, monitoring agent, or sufficiently privileged user inspects the running process's command-line arguments or retained process telemetry. 4. The attacker extracts the bearer API key. 5. The attacker sends authenticated requests directly to `https://aifs.space`. 6. Depending on the key type, the attacker lists, reads, creates, modifies, or deletes cloud-hosted files. ### Impact Assessment A compromised key grants all permissions assigned to that key: - A read-only key can expose stored cloud content. - A write-only key can allow unauthorized file creation or replacement. - A read-write key can perm ...[truncated 294 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Do not expand bearer credentials directly into command-line arguments. - Prefer an API client or credential mechanism that supplies sensitive headers without placing their values in the process argument list. - If `curl` must be used, load the authorization header through a permission-restricted configuration or header file and remove temporary material immediately after use. - Ensure credential files are readable only by the owning account, such as with mode `0600`. - Use a dedicated least-privilege key for each workflow rather than an administrator key. - Rotate any key suspected of appearing in process telemetry or diagnostic logs. - Prevent shell tracing, verbose HTTP logging, and CI job output from recording authorization headers. - Explicitly document secure secret provisioning and revocation procedures. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:139
Finding
Unsafe JSON Construction Using Remotely Stored File Content<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 139–148 **Vulnerability Type**: Improper encoding of untrusted data in a JSON request **Risk Level**: Medium ### Vulnerable Code ```bash # Read existing EXISTING=$(curl -s -H "Authorization: Bearer $KEY" "https://aifs.space/api/read?path=log.txt" | jq -r .content) # Append and write back curl -X POST -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \ -d "{\"path\":\"log.txt\",\"content\":\"$EXISTING\\n$(date): New entry\"}" \ https://aifs.space/api/write ``` ### Technical Analysis The recipe retrieves the contents of `log.txt` from remote storage and interpolates the result directly into a manually constructed JSON string. Shell quoting does not perform JSON encoding. If the stored content contains double quotes, backslashes, literal control characters, newlines, or crafted JSON syntax, the resulting request can be malformed or can alter the structure of the intended JSON object. Crafted duplicate properties may also be interpreted inconsistently depending on how the server-side JSON parser handles them. Although command substitution does not directly execute shell syntax contained in the value of `EXISTING`, the lack of JSON encoding creates a data-to-structure injection boundary. This is particularly relevant where another user, agent, or compromised integration can modify the remotely stored file before the append workflow runs. ### Attack Path 1. An attacker or collaborating user obtains permission to modify `log.txt`, or compromises another integration that can write to it. 2. The attacker stores content containing JSON metacharacters, quotes, backslashes, control characters, or crafted property syntax. 3. A victim runs the documented append workflow. 4. `jq -r` extracts the attacker's content into `EXISTING`. 5. The shell inserts that content directly into the JSON request without JSON escaping. 6. The request becomes malformed or contains attacker-influ ...[truncated 787 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Construct the request with a JSON-aware encoder rather than string interpolation. For example: ```bash EXISTING=$( curl -s \ -H "Authorization: Bearer $KEY" \ "https://aifs.space/api/read?path=log.txt" | jq -er '.content' ) printf '%s\n%s: New entry' "$EXISTING" "$(date)" | jq -Rs --arg path 'log.txt' '{path: $path, content: .}' | curl -X POST \ -H "Authorization: Bearer $KEY" \ -H "Content-Type: application/json" \ --data-binary @- \ https://aifs.space/api/write ``` Additional hardening should include: - Use `jq -e` so missing, null, or invalid response content causes the workflow to fail safely. - Check HTTP status codes with `curl --fail-with-body`. - Enforce an explicit maximum file size before reading content into a shell variable. - Validate server-side JSON against a strict schema and reject unknown or duplicate properties. - Use an atomic server-side append endpoint if available to avoid read-modify-write races and lost updates. - Apply least-privilege write permissions so untrusted parties cannot seed content consumed by the append workflow. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (5)

Vague Triggers

Medium
Confidence
91% confidence
Finding
The invocation text uses broad triggers such as 'persisting notes, documents, or data to the cloud' and 'cloud file storage,' which can match many common user intents and cause the skill to activate when the user did not explicitly ask to use AIFS. In this context, unintended activation is risky because the skill's core behavior is external transmission and remote file manipulation.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The skill instructs the agent to store, read, patch, and delete cloud-hosted files, but it does not require prominent user-facing confirmation that data will leave the local environment, persist remotely, and may be modified or deleted. The brief note 'Not to be used for any sensitive content' is insufficient because users may still unknowingly trigger external storage or destructive actions for ordinary requests.

External Transmission

Medium
Category
Data Exfiltration
Content
### List Files

```bash
curl -H "Authorization: Bearer $AIFS_API_KEY" https://aifs.space/api/files
```

Returns: `{"files": [{"path": "notes/todo.txt", "size": 1024, "modifiedAt": "..."}]}`
Confidence
86% confidence
Finding
This example sends authenticated requests to an external cloud storage service and demonstrates listing remote files. Even though the intent is functional documentation, it normalizes transferring metadata and interacting with third-party storage without embedding consent, minimization, or trust-boundary warnings, which increases the chance of unauthorized disclosure of user file names and structure.

External Transmission

Medium
Category
Data Exfiltration
Content
```bash
# Save
curl -X POST -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d "{\"path\":\"sessions/$(date +%Y-%m-%d).md\",\"content\":\"# Session Notes\\n...\"}" \
  https://aifs.space/api/write
Confidence
95% confidence
Finding
This example explicitly uploads session notes to a third-party service, creating a clear external transmission and persistence path for potentially sensitive conversational data. In skill context this is more dangerous because 'session notes' can easily contain private user information, and the example lacks mandatory sanitization, consent, retention, or confirmation controls.

External Transmission

Medium
Category
Data Exfiltration
Content
EXISTING=$(curl -s -H "Authorization: Bearer $KEY" "https://aifs.space/api/read?path=log.txt" | jq -r .content)

# Append and write back
curl -X POST -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d "{\"path\":\"log.txt\",\"content\":\"$EXISTING\\n$(date): New entry\"}" \
  https://aifs.space/api/write
```
Confidence
93% confidence
Finding
This pattern reads existing remote content and writes back an appended log entry, which can exfiltrate accumulated content and overwrite cloud data in one workflow. In context it is riskier than a simple write because it encourages bulk retrieval plus retransmission of prior log contents, increasing exposure and the chance of unintended modification if the wrong file or account is targeted.

Static analysis

No suspicious patterns detected.