Back to skill

Security audit

Ravenclaw - Email Bridge

Security checks for vulnerabilities and agentic risk

Overview

The skill is purpose-aligned for email automation, but it handles sensitive inbox and outbound-email actions with enough transport and execution-safety issues to require careful review.

Review before installing. Use this only with a trusted Ravenclaw instance, prefer localhost or HTTPS for any remote server, protect the .env mail credentials, and confirm recipients and message bodies before send or schedule commands. Treat Discord forwarding as sharing email contents with a third-party service, and be aware that the helper script may duplicate a state-changing request if the API returns a non-JSON response.

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
ops.sh:14
Finding

State-Changing API Requests May Be Executed Twice

Content
View full analysis

Vulnerability Details

File Location: ops.sh, lines 14-31
Vulnerability Type: Duplicate execution caused by response-formatting fallback
Risk Level: Medium

Vulnerable Code

bash
# Helper function for API calls
api_call() {
    local method=$1
    local endpoint=$2
    local data=$3
    
    if [ -n "$data" ]; then
        curl -s -X "$method" "$RAVENCLAW_URL$endpoint" \
            -H "Content-Type: application/json" \
            -d "$data" | python3 -m json.tool 2>/dev/null || \
        curl -s -X "$method" "$RAVENCLAW_URL$endpoint" \
            -H "Content-Type: application/json" \
            -d "$data"
    else
        curl -s -X "$method" "$RAVENCLAW_URL$endpoint" \
            -H "Content-Type: application/json" | python3 -m json.tool 2>/dev/null || \
        curl -s -X "$method" "$RAVENCLAW_URL$endpoint" \
            -H "Content-Type: application/json"
    fi
}

Technical Analysis

The first curl invocation is piped into python3 -m json.tool. The shell's || fallback is controlled by the exit status of the JSON formatter, not by whether the HTTP request was successfully processed.

If Ravenclaw successfully performs an operation but returns an empty, malformed, truncated, or non-JSON response, json.tool exits with a nonzero status. The fallback then issues the same HTTP request a second time.

This affects state-changing endpoints used elsewhere in the script, including:

  • POST /send
  • POST /schedule
  • POST /check
  • POST /schedule/cancel/<id>

A presentation-layer failure therefore changes application behavior and violates the expectation that one CLI invocation results in one API operation.

Attack Path

  1. A user invokes a state-changing command such as ./ops.sh send.
  2. The first curl request reaches Ravenclaw, which processes and sends the email.
  3. Ravenclaw, a reverse proxy, or an intermediary returns a succe ...[truncated 995 chars]
Remediation
View remediation

Remediation Suggestions

Execute each HTTP request exactly once. Capture the response before attempting presentation formatting:

bash
response=$(curl --fail-with-body -sS -X "$method" \
    "$RAVENCLAW_URL$endpoint" \
    -H "Content-Type: application/json" \
    ${data:+--data "$data"})
curl_status=$?

if [ "$curl_status" -ne 0 ]; then
    printf '%s\n' "$response" >&2
    return "$curl_status"
fi

if ! printf '%s' "$response" | python3 -m json.tool; then
    printf '%s\n' "$response"
fi

Because conditional argument expansion can be error-prone, separate data and no-data branches or use a Bash array for production code. Additional hardening should include:

  • Use curl --fail-with-body --show-error and inspect HTTP status codes.
  • Never retry non-idempotent requests solely because response parsing failed.
  • If retries are required, implement server-supported idempotency keys for send and schedule operations.
  • Print success messages only after confirming a successful HTTP status and valid application result.

T09 · Insecure Skill Coding Practices

Warning
Location
ops.sh:6
Finding

Sensitive Email and Inbox Data Can Be Transmitted over Plaintext HTTP

Content
View full analysis

Vulnerability Details

File Location: ops.sh, lines 6-31; SKILL.md, lines 169-171
Vulnerability Type: Cleartext transmission of sensitive information
Risk Level: Medium

Vulnerable Code

ops.sh configures a plaintext default URL and sends request and response data through that URL:

bash
# Configuration
RAVENCLAW_URL="${RAVENCLAW_URL:-http://localhost:5002}"
bash
# Helper function for API calls
api_call() {
    local method=$1
    local endpoint=$2
    local data=$3
    
    if [ -n "$data" ]; then
        curl -s -X "$method" "$RAVENCLAW_URL$endpoint" \
            -H "Content-Type: application/json" \
            -d "$data" | python3 -m json.tool 2>/dev/null || \
        curl -s -X "$method" "$RAVENCLAW_URL$endpoint" \
            -H "Content-Type: application/json" \
            -d "$data"
    else
        curl -s -X "$method" "$RAVENCLAW_URL$endpoint" \
            -H "Content-Type: application/json" | python3 -m json.tool 2>/dev/null || \
        curl -s -X "$method" "$RAVENCLAW_URL$endpoint" \
            -H "Content-Type: application/json"
    fi
}

SKILL.md explicitly documents a remote plaintext configuration:

bash
# Set environment variable
export RAVENCLAW_URL="http://your-server:5002"

Technical Analysis

Using plaintext HTTP on the loopback interface is generally acceptable when the service is strictly local and the host itself is trusted. However, the documented custom configuration encourages users to replace the local endpoint with a remote server while retaining the http:// scheme.

The API carries potentially sensitive information, including:

  • Email recipient addresses
  • Email subjects and message bodies
  • Scheduled-message details
  • Inbox and unread-message contents
  • Account, health, domain, and processing metadata
  • Commands that trigger email sending, cancellation, or inbox retrieval

When a no ...[truncated 1770 chars]

Remediation
View remediation

Remediation Suggestions

  • Permit plaintext HTTP only for loopback addresses such as localhost, 127.0.0.1, and ::1.
  • Reject non-loopback http:// values in RAVENCLAW_URL.
  • Require https:// for every remote Ravenclaw deployment.
  • Retain normal TLS certificate and hostname verification; do not add curl -k or --insecure.
  • Update the documentation to use an HTTPS example:
bash
export RAVENCLAW_URL="https://ravenclaw.example.com"
  • Add application authentication and authorization to the API if remote operation is supported.
  • Bind the Ravenclaw service to the loopback interface by default.
  • For private deployments, prefer a mutually authenticated TLS connection, VPN, or authenticated SSH tunnel.
  • Avoid returning unnecessary account details, complete message bodies, or other sensitive fields from health and statistics endpoints.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (12)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · README.md (reported line 48)May include surrounding context.

python ravenclaw.py

text

### 2. Configure .env

```env
EMAIL_HOST=mail.yourdomain.com

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · README.md (reported line 127)May include surrounding context.

python ravenclaw.py

text

### 2. Configure .env

```env
EMAIL_HOST=mail.yourdomain.com

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

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

python ravenclaw.py

text

### 2. Configure .env

```env
EMAIL_HOST=mail.yourdomain.com

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

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

python ravenclaw.py

text

### 2. Configure .env

```env
EMAIL_HOST=mail.yourdomain.com

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

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

python ravenclaw.py

text

### 2. Configure .env

```env
EMAIL_HOST=mail.yourdomain.com

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · ops.sh (reported line 21)May include surrounding context.

sh
local data=$3
    
    if [ -n "$data" ]; then
        curl -s -X "$method" "$RAVENCLAW_URL$endpoint" \
            -H "Content-Type: application/json" \
            -d "$data" | python3 -m json.tool 2>/dev/null || \
        curl -s -X "$method" "$RAVENCLAW_URL$endpoint" \

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · ops.sh (reported line 24)May include surrounding context.

sh
curl -s -X "$method" "$RAVENCLAW_URL$endpoint" \
            -H "Content-Type: application/json" \
            -d "$data" | python3 -m json.tool 2>/dev/null || \
        curl -s -X "$method" "$RAVENCLAW_URL$endpoint" \
            -H "Content-Type: application/json" \
            -d "$data"
    else

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The README advertises commands that send, schedule, and cancel emails, but it does not warn users that these actions transmit data externally and may be difficult or impossible to retract once processed. In an agent skill context, natural-language commands can be triggered with limited user awareness, so missing safety notice and confirmation guidance increases the risk of accidental data exfiltration or unintended outbound communication.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill explicitly describes forwarding inbox emails to Discord webhooks, which can expose potentially sensitive email contents to a third-party platform without any prominent privacy warning, consent guidance, or data-minimization caveat. In an email automation context this is materially risky because inbox contents may include confidential messages, attachments, or personal data, and users may enable forwarding without understanding the exposure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation shows plaintext storage of email credentials in a .env example but does not warn users that these values are secrets requiring secure handling. This increases the chance that users will commit credentials to source control, share screenshots/snippets, or store them with weak filesystem protections, leading to account compromise.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% 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 · ops.sh (reported line 21)May include surrounding context.

sh
local data=$3
    
    if [ -n "$data" ]; then
        curl -s -X "$method" "$RAVENCLAW_URL$endpoint" \
            -H "Content-Type: application/json" \
            -d "$data" | python3 -m json.tool 2>/dev/null || \
        curl -s -X "$method" "$RAVENCLAW_URL$endpoint" \

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% 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 · ops.sh (reported line 24)May include surrounding context.

sh
local data=$3
    
    if [ -n "$data" ]; then
        curl -s -X "$method" "$RAVENCLAW_URL$endpoint" \
            -H "Content-Type: application/json" \
            -d "$data" | python3 -m json.tool 2>/dev/null || \
        curl -s -X "$method" "$RAVENCLAW_URL$endpoint" \