Back to skill

Security audit

Sardis Policy

Security checks for vulnerabilities and agentic risk

Overview

This skill matches its Sardis wallet-policy purpose, but it can make durable spending-policy changes with a Sardis API key and includes risky shell examples that deserve review before installation.

Install only if you trust the Sardis integration and can use a least-privileged SARDIS_API_KEY. Review every policy before creation or replacement, avoid permissive templates unless intended, and prefer pinned dependencies plus safer jq-built JSON request bodies before copying the shell examples into automation.

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:16
Finding
Unpinned Third-Party npm Dependency<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:16-18` **Vulnerability Type**: Supply-chain risk from an unpinned dependency **Risk Level**: Medium ### Vulnerable Code ```yaml install: npm: - "@sardis/sdk" ``` ### Technical Analysis The Skill declares installation of `@sardis/sdk` without an exact version or integrity hash. Consequently, the package content installed in the future may differ from the content available when the Skill was audited. npm packages can define lifecycle scripts that execute during installation. If the package, its publishing account, or one of its transitive dependencies is compromised, a malicious release could execute code under the privileges of the user or agent installing the Skill. The package name appears consistent with the stated Sardis integration, and the audited file provides no evidence that it is currently malicious. The vulnerability is the mutable and unaudited dependency resolution process. ### Attack Path 1. An attacker compromises the npm publisher account, package distribution process, or a transitive dependency. 2. The attacker publishes a malicious version that satisfies the unspecified version selection. 3. A user or agent installs the Skill at a later time. 4. npm resolves the dependency to the malicious release. 5. Malicious package code or an npm lifecycle script executes during installation or when the SDK is imported. ### Impact Assessment Successful exploitation could execute arbitrary code with the privileges of the account performing installation. Depending on that account's permissions, an attacker could access environment variables such as `SARDIS_API_KEY`, read or modify accessible files, initiate network requests, alter the local development environment, or compromise wallet-management operations. The impact is limited by the privileges and sandboxing applied to the package installer, but a non-sandboxed installation could affect the entire user account. ]]>
Remediation
<![CDATA[ ## Remediation Suggestions - Pin the SDK to a reviewed exact version, rather than using an unconstrained package reference: ```yaml install: npm: - "@sardis/sdk@1.2.3" ``` - Maintain a lockfile containing npm integrity hashes and verify it during installation. - Review the direct package and its transitive dependency tree before approving upgrades. - Use `npm ci` for reproducible installation where the hosting framework permits it. - Disable lifecycle scripts with `npm ci --ignore-scripts` when they are not required. - Install dependencies in a sandbox with minimal filesystem access and without sensitive environment variables. - Use package provenance verification, dependency scanning, and an allowlisted private registry or proxy where appropriate. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:246
Finding
Unsafe Shell Expansion in JSON Request Construction<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:246-266` **Additional Locations**: `SKILL.md:280-295`, `SKILL.md:306-313` **Vulnerability Type**: Unquoted shell expansion and unsafe JSON construction **Risk Level**: High ### Vulnerable Code ```bash # Always test policy before executing payment WALLET_ID=wallet_abc123 AMOUNT=75.00 VENDOR=openai.com CHECK_RESULT=$(curl -s -X POST https://api.sardis.sh/v2/policies/check \ -H "Authorization: Bearer $SARDIS_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "wallet_id": "'$WALLET_ID'", "amount": "'$AMOUNT'", "vendor": "'$VENDOR'" }') if echo $CHECK_RESULT | jq -e '.allowed == true' > /dev/null; then echo "Payment would be approved" echo "Remaining daily: $(echo $CHECK_RESULT | jq -r '.remaining_daily')" else echo "Payment would be BLOCKED" echo "Reason: $(echo $CHECK_RESULT | jq -r '.reason')" fi ``` The same construction pattern is used in the batch example: ```bash echo "$TRANSACTIONS" | jq -c '.[]' | while read tx; do AMOUNT=$(echo $tx | jq -r '.amount') VENDOR=$(echo $tx | jq -r '.vendor') RESULT=$(curl -s -X POST https://api.sardis.sh/v2/policies/check \ -H "Authorization: Bearer $SARDIS_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "wallet_id": "'$WALLET_ID'", "amount": "'$AMOUNT'", "vendor": "'$VENDOR'" }') ALLOWED=$(echo $RESULT | jq -r '.allowed') echo "$AMOUNT to $VENDOR: $ALLOWED" done ``` ### Technical Analysis The examples terminate a single-quoted JSON string, expand shell variables outside quotes, and then reopen the quoted string: ```bash "vendor": "'$VENDOR'" ``` Because `$WALLET_ID`, `$AMOUNT`, and `$VENDOR` are unquoted during expansion, the shell applies word splitting and pathname expansion to their values. A value containing spaces, wildcard characters, quotes, or strings resembling curl arguments can therefore change the argument boundaries passed to curl. Independently, JSON met ...[truncated 2819 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Construct request bodies with `jq` so every value receives correct JSON escaping, and quote every shell expansion: ```bash payload=$(jq -n \ --arg wallet_id "$WALLET_ID" \ --arg amount "$AMOUNT" \ --arg vendor "$VENDOR" \ '{ wallet_id: $wallet_id, amount: $amount, vendor: $vendor }') CHECK_RESULT=$(curl --fail-with-body --silent --show-error \ --request POST \ --url "https://api.sardis.sh/v2/policies/check" \ --header "Authorization: Bearer $SARDIS_API_KEY" \ --header "Content-Type: application/json" \ --data-raw "$payload") ``` Apply the following additional controls: - Validate `WALLET_ID` against the documented identifier format before use. - Validate amounts with a strict decimal pattern and enforce an expected numeric range. - Validate vendors as canonical hostnames or against an explicit allowlist. - Quote response variables: ```bash if printf '%s\n' "$CHECK_RESULT" | jq -e '.allowed == true' >/dev/null; then printf 'Remaining daily: %s\n' \ "$(printf '%s\n' "$CHECK_RESULT" | jq -r '.remaining.daily // .remaining_daily')" fi ``` - Use `IFS= read -r tx` in loops to prevent backslash interpretation and preserve complete input records. - Reject malformed or unexpected JSON response schemas rather than treating parsing failures as normal policy denials. - Use `--fail-with-body`, explicit timeouts, and an allowlisted fixed URL. - Run curl in a restricted environment with outbound network access limited to the intended Sardis API host. - Avoid placing authorization headers on any invocation that may accept dynamically generated URL operands. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (20)

External Transmission

Medium
Category
Data Exfiltration
Content
env:
        - SARDIS_API_KEY
      bins:
        - curl
        - jq
    primaryEnv: SARDIS_API_KEY
    emoji: "🛡️"
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
## API Endpoint Patterns

Base URL: `https://api.sardis.sh/v2`

### Create Policy with Natural Language
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
## API Endpoint Patterns

Base URL: `https://api.sardis.sh/v2`

### Create Policy with Natural Language
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
## API Endpoint Patterns

Base URL: `https://api.sardis.sh/v2`

### Create Policy with Natural Language
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
## API Endpoint Patterns

Base URL: `https://api.sardis.sh/v2`

### Create Policy with Natural Language
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
## API Endpoint Patterns

Base URL: `https://api.sardis.sh/v2`

### Create Policy with Natural Language
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
## API Endpoint Patterns

Base URL: `https://api.sardis.sh/v2`

### Create Policy with Natural Language
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
## API Endpoint Patterns

Base URL: `https://api.sardis.sh/v2`

### Create Policy with Natural Language
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
## API Endpoint Patterns

Base URL: `https://api.sardis.sh/v2`

### Create Policy with Natural Language
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
## API Endpoint Patterns

Base URL: `https://api.sardis.sh/v2`

### Create Policy with Natural Language
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
## API Endpoint Patterns

Base URL: `https://api.sardis.sh/v2`

### Create Policy with Natural Language
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
## API Endpoint Patterns

Base URL: `https://api.sardis.sh/v2`

### Create Policy with Natural Language
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
## API Endpoint Patterns

Base URL: `https://api.sardis.sh/v2`

### Create Policy with Natural Language
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
## API Endpoint Patterns

Base URL: `https://api.sardis.sh/v2`

### Create Policy with Natural Language
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
## API Endpoint Patterns

Base URL: `https://api.sardis.sh/v2`

### Create Policy with Natural Language
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
## API Endpoint Patterns

Base URL: `https://api.sardis.sh/v2`

### Create Policy with Natural Language
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
# - Higher per-transaction ($500)
# - API vendor allowlist
# - 24/7 allowed (services don't sleep)
# - Auto-approve under $100
```

### Template: Restricted Trial
Confidence
85% 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.

External Transmission

Medium
Category
Data Exfiltration
Content
AMOUNT=$(echo $tx | jq -r '.amount')
  VENDOR=$(echo $tx | jq -r '.vendor')

  RESULT=$(curl -s -X POST https://api.sardis.sh/v2/policies/check \
    -H "Authorization: Bearer $SARDIS_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
WALLET_ID=wallet_abc123

# Create new policy
NEW_POLICY=$(curl -s -X POST https://api.sardis.sh/v2/policies \
  -H "Authorization: Bearer $SARDIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
| Template | Use Case | Key Features |
|----------|----------|--------------|
| `conservative-procurement` | Purchasing agent | Low limits, vendor allowlist, approval required |
| `api-service-agent` | API/SaaS agent | Higher limits, 24/7, auto-approve |
| `restricted-trial` | Trial/demo | Very low limits, expires |
| `employee-card` | Employee spending | Moderate limits, category blocks |
| `unrestricted` | Trusted agent | High limits, minimal restrictions |
Confidence
85% 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.

Static analysis

No suspicious patterns detected.